qis.RegimeData

class qis.RegimeData(*values)[source]

Bases: Enum

which statistic a regime-conditional table reports.

Selects the panel produced by compute_regimes_pa_perf_table() and rendered by plot_regime_data(). Only the average is a within-regime statistic; the p.a. and Sharpe panels are frequency-weighted contributions of each regime to a full-sample total, so they add up across regimes and are not the return or Sharpe ratio earned inside a regime.

Variables:
  • REGIME_AVG – conditional mean periodic return within each regime, m_g, on the classifier’s grid and return basis

  • REGIME_PA – per-annum contribution of each regime, exp(af * p_g * m_g) - 1 with p_g the regime frequency, shifted by p_g times the residual so the regimes add up to the table’s PA_RETURN (native endpoints)

  • REGIME_SHARPE – Sharpe-ratio contribution of each regime in the convention carried on PerfParams.sharpe_convention: under ARITHMETIC and LOG, sqrt(af) * p_g * m_g over the full-sample standard deviation, adding up to the Sharpe ratio on the regime grid; under PA, the REGIME_PA contribution over VOL, adding up to PA_RETURN / VOL, which equals SHARPE_RF0 only when the native endpoints lie on the freq_vol grid. See qis/docs/sharpe_conventions.md

__init__(*args, **kwds)

Attributes

REGIME_AVG = 'Average'
REGIME_PA = 'P.a.'
REGIME_SHARPE = '-Sharpe'