Spaces:
Sleeping
Sleeping
File size: 1,152 Bytes
459d15e 29fe302 459d15e 29fe302 459d15e 29fe302 459d15e 95cb276 459d15e 29fe302 459d15e 29d2f96 459d15e 29d2f96 459d15e 29d2f96 459d15e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | import plotly.graph_objects as go
def plot_simulated_shocks(
shocks,
columns,
):
fig = go.Figure()
for i, column in enumerate(columns):
fig.add_trace(
go.Histogram(
x=shocks[:, i],
name=column,
opacity=0.55,
nbinsx=80,
)
)
fig.update_layout(
title="Simulated Market Shocks",
xaxis_title="Shock",
yaxis_title="Frequency",
barmode="overlay",
template="plotly_white",
)
return fig
def plot_scenario_distributions(
scenario_prices,
columns,
):
fig = go.Figure()
for i, column in enumerate(columns):
fig.add_trace(
go.Histogram(
x=scenario_prices[:, i],
name=column,
opacity=0.65,
)
)
fig.update_layout(
title="Simulated Scenario Price Distributions",
xaxis_title="Simulated Price",
yaxis_title="Frequency",
barmode="overlay",
template="plotly_white",
)
return fig |