okama.EfficientFrontier.plot_cml
- EfficientFrontier.plot_cml(rf_return=0, y_axe='cagr', figsize=None)
Plot Capital Market Line (CML).
The Capital Market Line (CML) is the tangent line drawn from the point of the risk-free asset (volatility is zero) to the point of tangency portfolio or Maximum Sharpe Ratio (MSR) point.
The slope of the CML is the Sharpe ratio of the tangency portfolio.
- Parameters:
- rf_returnfloat, default 0
Risk-free rate of return.
- y_axe{‘cagr’, ‘mean_return’}, default ‘cagr’
Show the relation between Risk and CAGR (if ‘cagr’) or between Risk and Mean rate of return (if ‘mean_return’). CAGR or Mean Rate of Return are displayed on the y-axis.
- figsize(float, float), optional
Figure size: width, height in inches. If None default matplotlib size is taken: [6.4, 4.8]
- Returns:
- Axes‘matplotlib.axes._subplots.AxesSubplot’
Examples
>>> import matplotlib.pyplot as plt >>> three_assets = ['MCFTR.INDX', 'RGBITR.INDX', 'GC.COMM'] >>> ef = ok.EfficientFrontier(assets=three_assets, ccy='USD', full_frontier=True) >>> ef.plot_cml(rf_return=0.05, y_axe="cagr") # Risk-Free return is 5% >>> plt.show