okama.Portfolio.percentile_wealth_history

Portfolio.percentile_wealth_history(years=1, percentiles=[10, 50, 90])

Calculate portfolio wealth index percentiles.

Percentiles are derived from rolling CAGR historical distribution. CAGR - Compound Annual Growth Rate. Wealth index (Cumulative Wealth Index) is a time series that presents the value of portfolio over a given time period.

Actual portfolio wealth is adjusted to the last known historical value (from ‘wealth_index’). It is useful for a chart with historical wealth index and forecasted values.

Parameters:
years: int, default 1

Time frame for portfolio wealth index percentiles. It should not exceed 1/2 of the portfolio history period length ‘period_length’. Percentiles are calculated for periods from 1 to ‘years’.

percentiles: list of int, default [10, 50, 90]

List of percentiles to be calculated.

Returns:
DataFrame

Table with portfolio wealth index percentiles for each period from 1 to ‘years’.

Examples

>>> pf = ok.Portfolio(['SPY.US', 'AGG.US', 'GLD.US'], weights=[.60, .35, .05], rebalancing_period='month')
>>> pf.percentile_wealth_history(years=5)
                10           50           90
years
1      3815.660408  4202.758919  4457.210561
2      3727.946026  4540.888480  5005.291952
3      3797.214674  4855.631902  5384.216628
4      4173.503054  5274.584657  6018.571025
5      4613.287195  5706.343210  6694.576137