percentile_inverse_cagr

Portfolio.percentile_inverse_cagr(years=1, score=0)

Compute the percentile rank of a score (CAGR value).

Percentile rank can be calculated for a historical distribution of CAGR.

If percentile_inverse of, for example, 0% (CAGR value) is equal to 8% for 1 year time frame it means that 8% of the CAGR values in the distribution are negative in 1 year periods. Or in other words the probability of getting negative result after 1 year of investments is 8%.

Parameters:
yearsint, default 1

Period length (time frame) in years when CAGR is calculated.

scorefloat, default 0

Score that is compared to the elements in CAGR array.

Returns:
float

Percentile-position of score (0-100) relative to distribution.

Examples

>>> pf = ok.Portfolio(
...     ["SPY.US", "AGG.US", "GLD.US"],
...     weights=[0.60, 0.35, 0.05],
...     rebalancing_strategy=ok.Rebalance(period="year"),
... )
>>> pf.percentile_inverse_cagr(score=0, years=1)
18.08
The probability of getting negative result (score=0) in 1 year period for historical distribution.