percentile_inverse_cagr
- MonteCarlo.percentile_inverse_cagr(score=0)
Compute the percentile rank of a CAGR value within the simulated distribution.
The percentile rank is calculated from the Monte Carlo CAGR distribution produced by the current Monte Carlo settings.
For example, if the percentile rank for score=0 is 8 for a 1-year horizon, it means that 8% of simulated CAGR values are negative over 1-year periods.
- Parameters:
- scorefloat, default 0
CAGR value to evaluate.
- Returns:
- float
Percentile rank (0-100).
Examples
>>> pf = ok.Portfolio( ... ["SPY.US", "AGG.US", "GLD.US"], ... weights=[0.60, 0.35, 0.05], ... rebalancing_strategy=ok.Rebalance(period="year"), ... ) >>> pf.dcf.set_mc_parameters(distribution="lognorm", period=1, mc_number=5000) >>> pf.dcf.mc.percentile_inverse_cagr(score=0) ... The probability of getting negative result (score=0) in 1 year period for lognormal distribution.