qis.regimes.compute_regime_ewm_avg

qis.regimes.compute_regime_ewm_avg(sampled_returns_with_regime_id, span=40.0, regime_column='regime')[source]

EWMA conditional means with the span applied within each regime’s own return stream.

Parameters:
  • sampled_returns_with_regime_id (DataFrame) – periodic returns with a regime column

  • span (float) – EWMA span in regime-time periods

  • regime_column (str) – name of the regime column

Returns:

the last EWMA value of each regime’s stream, seeded at the stream mean

Return type:

regimes in rows, in bucket order, and assets in columns