qis.regimes.compute_sample_regime_moments¶
- qis.regimes.compute_sample_regime_moments(sampled_returns_with_regime_id, benchmark, regime_column='regime')[source]¶
Per-period empirical regime moments of the benchmark on a supplied classification.
The empirical counterpart of
compute_gaussian_regime_moments. Unclassified periods are excluded; every classified benchmark return must be finite and every regime occupied. The means and second moments are equal-weighted population moments (ddof=0), not sample variances. The function neither classifies nor resamples, and it uses every period it is given: a rolling caller passes only the periods known at the decision date.- Parameters:
- Returns:
regimes in rows, in bucket order, and the columns
probability, the empirical frequency of the classified periods,meanandsecond_moment- Raises:
ValueError – if the columns, the labels, the classified benchmark returns or the regimes are invalid
- Return type: