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: sigma and the regime means m_s over each asset’s available returns, p_s over all classified periods, and the Sharpe ratio by compute_sharpe_arithmetic with ddof=1.

Parameters:
  • sampled_returns_with_regime_id (DataFrame) – periodic returns with a regime column, as returned by BenchmarkReturnsQuantilesRegime.compute_sampled_returns_with_regime_id or create_sampled_returns_with_regime_id

  • benchmark (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>_sharpe per regime, null_<tail>_sharpe, convexity_premium, cp_star and <tail>_return_pa, the annualised return contribution of the lowest bucket; with nu also null_<tail>_sharpe_t and convexity_premium_t

Raises:

ValueError – if the benchmark is missing or the regime labels are not the ids of q

Return type:

DataFrame