qis.regimes.compute_regime_premium_table¶
- qis.regimes.compute_regime_premium_table(sampled_returns_with_regime_id, benchmark, af, q=None, nu=None, regime_column='regime')[source]¶
Regime decomposition, null and convexity premium of every asset of a sampled frame.
Moments are equal-weighted over the periods with a regime:
sigmaand the regime meansm_sover each asset’s available returns,p_sover all classified periods, and the Sharpe ratio bycompute_sharpe_arithmeticwithddof=1.- Parameters:
sampled_returns_with_regime_id (DataFrame) – periodic returns with a regime column, as returned by
BenchmarkReturnsQuantilesRegime.compute_sampled_returns_with_regime_idorcreate_sampled_returns_with_regime_idbenchmark (str) – name of the benchmark column
af (float) – annualisation factor of the periodic returns
q (Sequence[float] | ndarray | None) – the partition that produced the regimes; None is the one-sigma cut
nu (float | None) – degrees of freedom of an additional Student-t null; None reports the Gaussian only
regime_column (str) – name of the regime column
- Returns:
one row per asset and the columns
sharpe,rho,ann_vol, one<id>_sharpeper regime,null_<tail>_sharpe,convexity_premium,cp_starand<tail>_return_pa, the annualised return contribution of the lowest bucket; withnualsonull_<tail>_sharpe_tandconvexity_premium_t- Raises:
ValueError – if the benchmark is missing or the regime labels are not the ids of
q- Return type: