Regime Adjusted Exponentially Weighted Covariance

The Regime Adjusted Exponentially Weighted Covariance rescales an exponentially weighted covariance by a short-term volatility update: a multiplier that compares the risk the covariance predicted with the risk that followed, so the estimate catches up when volatility changes faster than the exponential average can follow (Paleologo, 2025).

The formula for the Regime Adjusted Exponentially Weighted Covariance starts from the exponentially weighted covariance \(S_{t}\) after t periods, with lambda the decay of the half-life H in periods, the returns \(r_{t}\) taken around zero and the recursion started at zero, corrected for that start in \(P_{t}\):

\[\lambda = 2^{-1/H}\] \[S_{t} = \lambda \cdot S_{t-1} + (1 - \lambda) \cdot r_{t} \cdot r'_{t}\] \[P_{t} = \frac{S_{t}}{1 - \lambda^{t}}\]

Every period compares the absolute return of the inverse volatility portfolio \(w_{t}\) with its predicted volatility, scaled so that it averages 1 when the risk is predicted well, with pi the circle constant:

\[z_{t} = \frac{\frac{\left\lvert w'_{t} \cdot r_{t}\right\rvert}{\sqrt{w'_{t} \cdot P_{t-1} \cdot w_{t}}}}{\sqrt{\frac{2}{\pi}}}\]

The multiplier phi, the exponential average of \(z_{t}\) with half-life H / 2, kept between 0.7 and 1.6, scales the covariance after the last period T:

\[\Sigma = \phi^{2} \cdot P_{T}\]

A phi above 1 means recent returns were larger than predicted, and the estimate raises every variance and covariance by the same factor.

Its parameters can be set, and it can be shown as a correlation matrix. The covariance matrix holds the variance of every asset and the covariance of every pair, the risk input of the mean-variance analysis of Markowitz (1952). With N assets it holds N (N + 1) / 2 numbers to estimate, and when N is not small compared to the number of periods T, the sample estimate is noisy and ill-conditioned: its smallest eigenvalues come out too small, and an optimizer that inverts it puts large weights on the combinations of assets that only look safe in the sample. The estimators differ in how they deal with this: by shrinking towards a structured target, by cleaning the eigenvalues, by weighting recent periods, by counting only large moves or by resisting outliers. Every estimate is annualized with the number of periods in a year.

Also known as: regime adjusted EWMA covariance, short-term volatility update, STVU.

In the Finance Toolkit this is get_covariance_estimate with method="regime_adjusted_ew", the same function as Covariance Estimate.

Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_covariance_estimate:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "JNJ", "XOM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.portfolio.get_covariance_estimate(method="regime_adjusted_ew")

Which returns:

References

  • Paper Paleologo, G. A. (2025). “The Elements of Quantitative Investing.” Wiley Finance.
  • Library Referenced against skfolio’s RegimeAdjustedEWCovariance (Regime Adjusted Exponentially Weighted Covariance, its defaults)
Share