|
25 | 25 | portf.dcf.plot_forecast_monte_carlo(distr="norm", years=30, backtest=True, n=100)
|
26 | 26 |
|
27 | 27 | s_periods = portf.dcf.monte_carlo_survival_period(distr="lognorm", years=25, n=10)
|
28 |
| -print(f"медиана {s_periods.quantile(50 / 100)}") |
29 |
| -print(f"первый порцентиль {s_periods.quantile(1 / 100)}") |
30 |
| -print(f"99й порцентиль {s_periods.quantile(99 / 100)}") |
31 |
| -print(f"минимум {s_periods.min()}") |
32 |
| -print(f"среднее {s_periods.mean()}") |
33 |
| - |
34 |
| -plt.show() |
| 28 | +print(f"median {s_periods.quantile(50 / 100)}") |
| 29 | +print(f"1st percentile {s_periods.quantile(1 / 100)}") |
| 30 | +print(f"99th percentile {s_periods.quantile(99 / 100)}") |
| 31 | +print(f"min {s_periods.min()}") |
| 32 | +print(f"max {s_periods.mean()}") |
35 | 33 |
|
36 | 34 | # Rolling / Expanding Risk
|
37 | 35 |
|
38 |
| -# al = ok.AssetList(['DJI.INDX', |
39 |
| -# 'BND.US' |
40 |
| -# ]) |
41 |
| -# print(al) |
42 |
| -# al.get_rolling_risk_annual(window=12*20).plot() |
43 |
| -# # al.get_rolling_cagr(window=12*20, real=True).plot() |
44 |
| -# |
45 |
| -# plt.show() |
46 |
| - |
47 |
| -# pf = ok.Portfolio(['SPY.US', |
48 |
| -# 'BND.US' |
49 |
| -# ]) |
50 |
| -# rf3 = ok.Portfolio( |
51 |
| -# ["BND.US", "VTI.US", "VXUS.US"], |
52 |
| -# weights=[0.40, 0.40, 0.20], |
53 |
| -# rebalancing_period="year", |
54 |
| -# ) |
55 |
| -# print(rf3.recovery_period) |
| 36 | +al = ok.AssetList(['DJI.INDX', |
| 37 | + 'BND.US' |
| 38 | + ]) |
| 39 | +al.get_rolling_risk_annual(window=12*20).plot() |
| 40 | + |
| 41 | +plt.show() |
| 42 | + |
0 commit comments