okama.EfficientFrontier.plot_transition_map
- EfficientFrontier.plot_transition_map(x_axe='risk', figsize=None)
Plot Transition Map for optimized portfolios on the single period Efficient Frontier.
Transition Map shows the relation between asset weights and optimized portfolios properties:
CAGR (Compound annual growth rate)
Risk (annualized standard deviation of return)
Wights are displayed on the y-axis. CAGR or Risk - on the x-axis.
Constrained optimization with weights bounds is available.
- Parameters:
- boundstuple of ((float, float),…)
Bounds for the assets weights. Each asset can have weights limitation from 0 to 1.0. If an asset has limitation for 10 to 20%, bounds are defined as (0.1, 0.2). bounds = ((0, .5), (0, 1)) shows that in Portfolio with two assets first one has weight limitations from 0 to 50%. The second asset has no limitations.
- x_axe{‘risk’, ‘cagr’}, default ‘risk’
Show the relation between weights and CAGR (if ‘cagr’) or between weights and Risk (if ‘risk’). CAGR or Risk are displayed on the x-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 >>> x = ok.EfficientFrontier(['SPY.US', 'AGG.US', 'GLD.US'], ccy='USD', inflation=False) >>> x.plot_transition_map() >>> plt.show()
Transition Map with default setting show the relation between Risk (stanrd deviation) and assets weights for optimized portfolios. The same relation for CAGR can be shown setting x_axe=’cagr’.
>>> x.plot_transition_map(x_axe='cagr') >>> plt.show()