EWMA Mean-Variance

Mean-variance optimisation with exponentially weighted moments. The classical MVO inputs - the mean vector and the covariance matrix - are estimated using exponentially weighted moving averages with a decay factor fixed at 0.94, so the optimiser adapts to the most recent volatility regime instead of weighting all observations equally. The decay is not a request field.

Overview

The standard sample estimators of and weight every observation equally inside the lookback window. That assumption is convenient but counterfactual: realised volatility clusters in time (Mandelbrot, 1963; Engle, 1982), and a sudden regime change should propagate into the optimiser's view of risk faster than an equally-weighted estimator allows. The EWMA approach popularised by J.P. Morgan's RiskMetrics (1996) replaces the sample mean and covariance with their exponentially-weighted analogues.

FolioLab's EWMA mean-variance variant uses the same first-order recursion as RiskMetrics: each new return is mixed in with weight while older history decays geometrically with factor . The standard RiskMetrics decay for daily equity data is , corresponding to a half-life of roughly 11 trading days. The resulting estimates are fed into the same tangency / max-Sharpe formulation as the classical MVO, so the only difference is the moment estimator.

The method is a strict generalisation of the equally-weighted moment estimator (which is the limit ) and is considerably simpler than full GARCH (Bollerslev, 1986), which would jointly estimate the conditional variance dynamics with maximum likelihood at substantially higher cost.

Mathematical Formulation

EWMA mean

Equivalently, in batch form, .

EWMA covariance

The recursion is the same as for the mean: each new outer-product of centered returns is mixed in with weight . The value gives an effective half-life near 11 trading days, which is the canonical RiskMetrics setting for daily equity data.

The shipped estimator divides the weighted sum of outer products by a finite-sample correction, not by 1. With normalised weights , the divisor is:

This is the exponential-weight analogue of the divisor in a sample covariance. It removes the downward bias that comes from centering on a mean estimated from the same weighted sample. The floor of guards the degenerate case where one observation carries almost all the weight.

The decay also sets a practical width limit. A decay of 0.94 fixes the effective sample size at roughly 32 observations, whatever the history length. So a wider universe fits more covariance entries from the same amount of information, and the matrix becomes ill-conditioned. Near 102 instruments the solve stops converging inside the solver's positive-semidefinite check. The method refuses the run at that point and reports the instrument count, the effective observation count and the condition number, rather than returning a portfolio from a near-singular estimate. Every run reports those three numbers, including a run that succeeds.

Plug-in MVO

The EWMA-estimated and are substituted directly into the standard MVO programme:

FolioLab implements this via PyPortfolioOpt's EfficientFrontier.max_sharpe with the EWMA-estimated moments. The three constraint families the platform supports are available unchanged: per-name weight bounds, asset exclusions, and group sum limits such as sector caps. Turnover budgets, tracking-error constraints and target-return rows are not available on this or any other method.

Half-life and decay choice

The half-life implied by a decay factor is . So gives trading days (the RiskMetrics daily default), and gives days. The trade-off is standard: a smaller reacts faster to new information but is noisier; a larger is more stable but slower to detect regime changes.

Advantages & Limitations

Advantages

  • Adaptive risk: Captures volatility clustering without estimating GARCH.
  • Single hyperparameter, and it is fixed: The decay is the only quantity that shapes the estimator, and it is pinned at 0.94 on every run rather than set per run.
  • Standardised: RiskMetrics defaults are widely used and understood by risk teams.
  • Plug-and-play: Substitutes into the MVO solve without changing which constraints are available.

Limitations

  • Mean is still noisy: EWMA mean reduces variance only at the cost of bias.
  • Non-stationary periods amplify weights: Recent extreme returns dominate the estimate.
  • No regime structure: EWMA assumes smooth decay; HMM-Regime MVO is preferred when regimes are discrete.
  • Decay choice is universal: The same is applied to all assets.

References

  • J.P. Morgan / Reuters (1996). RiskMetrics - Technical Document (4th ed.). New York: Morgan Guaranty Trust Company.
  • Engle, R. F. (1982). "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica, 50(4), 987-1007.
  • Bollerslev, T. (1986). "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics, 31(3), 307-327.
  • Mandelbrot, B. (1963). "The Variation of Certain Speculative Prices." The Journal of Business, 36(4), 394-419.
  • Tsay, R. S. (2010). Analysis of Financial Time Series (3rd ed.). Wiley.
  • Markowitz, H. (1952). "Portfolio Selection." The Journal of Finance, 7(1), 77-91.
  • PyPortfolioOpt documentation - EfficientFrontier.max_sharpe.

Not investment advice. Past performance is not indicative of future results.