Skip to content

Commit c52f3ef

Browse files
committed
docs: update get_monte_carlo() documentation
1 parent fa9c280 commit c52f3ef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

okama/frontier/single_period.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ def get_monte_carlo(self, n: int = 100, kind: str = "mean") -> pd.DataFrame:
810810
Returns
811811
-------
812812
DataFrame
813-
Table with Return and Risk values for random portfolios.
813+
Table with Return, Risk and weights values for random portfolios.
814814
815815
Parameters
816816
----------
@@ -826,17 +826,17 @@ def get_monte_carlo(self, n: int = 100, kind: str = "mean") -> pd.DataFrame:
826826
>>> base_currency = 'EUR'
827827
>>> y = ok.EfficientFrontier(assets, ccy=base_currency, last_date=last_date)
828828
>>> y.get_monte_carlo(n=10) # generate 10 random portfolios
829-
Return Risk
830-
0 0.090393 0.101900
831-
1 0.075611 0.087561
832-
2 0.100580 0.151436
833-
3 0.109584 0.108251
834-
4 0.092985 0.092296
835-
5 0.086165 0.108419
836-
6 0.116168 0.141825
837-
7 0.079040 0.090309
838-
8 0.093917 0.092967
839-
9 0.102236 0.115301
829+
Risk Return SPY.US AGG.US GLD.US
830+
0 0.099168 0.101667 0.470953 0.205227 0.323819
831+
1 0.099790 0.076282 0.070792 0.558928 0.370280
832+
2 0.129312 0.106620 0.274261 0.050524 0.675215
833+
3 0.102031 0.083311 0.129375 0.443444 0.427182
834+
4 0.102956 0.105136 0.489213 0.146174 0.364614
835+
5 0.095690 0.091834 0.297122 0.335066 0.367812
836+
6 0.103747 0.090285 0.203408 0.334694 0.461898
837+
7 0.148311 0.099617 0.082660 0.120871 0.796470
838+
8 0.115780 0.082983 0.042871 0.422335 0.534794
839+
9 0.093903 0.088553 0.266303 0.387332 0.346365
840840
841841
To plot Monte Carlo simulation result it's useful to combine in with the Efficien Frontier chart.
842842
Additionaly assets points could be plotted with 'Plot.plot_assets()'.

0 commit comments

Comments
 (0)