Quant Terminal
D1-08D1·intermediate·~21 min

EWMA and practical volatility — from forecast to position size

time-seriesvolatilityewmariskmetricsvol-targetingposition-sizing

▸ Pretest — guess, even if you don't know

You compute vol as a 20-day rolling standard deviation. Twenty-one trading days after a single crash day, your vol estimate suddenly drops by a third — on a completely uneventful day. What happened?

EWMA: GARCH's pragmatic little sibling

Take GARCH(1,1) from D1-07 and make two brutal simplifications. Drop the floor: set ω=0\omega = 0 ("omega equals zero"). Force persistence to exactly one: α+β=1\alpha + \beta = 1. Only one free parameter survives; rename it λ\lambda — the Greek letter lambda, playing the old β\beta role. What's left is the EWMA — exponentially weighted moving average — of squared returns:

σt2=λσt12+(1λ)rt12\sigma_t^2 = \lambda\, \sigma_{t-1}^2 + (1-\lambda)\, r_{t-1}^2

In words: today's variance equals lambda times yesterday's variance, plus (1 minus lambda) times yesterday's squared return. Lambda is a memory dial between 0 and 1: the closer to 1, the more yesterday's estimate dominates and the less one new day can move it. Concrete numbers: with λ=0.94\lambda = 0.94, yesterday's variance 0.0004, and a −1% day yesterday (squared: 0.0001), today's variance is 0.94×0.0004+0.06×0.0001=0.0003820.94 \times 0.0004 + 0.06 \times 0.0001 = 0.000382.

One parameter instead of three, and no fitting: J.P. Morgan's RiskMetrics standardized λ=0.94\lambda = 0.94 for daily data in 1996, and much of the industry still runs it. Unrolling the recursion shows where the name comes from. Today's variance is a weighted sum of all past squared returns, where the return kk days ago gets weight (1λ)λk(1-\lambda)\lambda^k — read "(one minus lambda) times lambda to the power k" — so the weights shrink geometrically with age. Yesterday matters most; last month whispers; last year is gone.

What you give up versus full GARCH: because α+β=1\alpha + \beta = 1, the long-run variance formula ω/(1αβ)\omega / (1 - \alpha - \beta) divides by zero. There is no unconditional (long-run) variance — that's the answer to D1-07's closing prediction — and hence no mean reversion. EWMA's forecast for every future horizon is simply today's estimate, whereas GARCH glides back to the long-run anchor. For 1-to-5-day risk that difference barely matters. For pricing a 1-year option it matters a lot. For a trading desk sizing tomorrow's positions, EWMA's robustness usually wins: no three-parameter fit to go wrong, no unstable ω\omega.

Effective lookback: about 17 days

A geometric decay has no hard cutoff — old days never get exactly zero weight. But its center of mass sits at roughly

effective lookback11λ=10.0617 days\text{effective lookback} \approx \frac{1}{1-\lambda} = \frac{1}{0.06} \approx 17 \text{ days}

In words: the effective lookback is about one divided by (one minus lambda). At the RiskMetrics λ=0.94\lambda = 0.94, that's 1 divided by 0.06 — about 17 days.

So RiskMetrics EWMA behaves like "a ~17-day window, but blurry at the edges." Raise λ\lambda to 0.97 and you get a smoother, slower ~33-day memory; drop to 0.90 for a twitchy ~10-day one. One dial trades responsiveness against noise. It's the same tension as choosing a rolling window length — minus the cliff you're about to see.

Rolling window vs EWMA: the step response

Think like an engineer and feed both estimators a single impulse — one crash day in an otherwise calm series — then watch each estimate respond:

Faster reaction and graceful forgetting, for one parameter — that's why EWMA is the practical default. One upgrade is worth knowing about: realized volatility — a day's variance estimated from higher-frequency returns within that day (for example, 5-minute bars). It measures each single day far more precisely and is the modern research standard. We only wave at it here, since daily bars are what free data gives you.

From forecast to position: vol targeting

Here is the whole practical recipe that D1-07 promised. Pick a target volatility for the strategy, then scale the position by

wt=min ⁣(σtargetσ^t,  wmax)w_t = \min\!\left(\frac{\sigma_{\text{target}}}{\hat{\sigma}_t},\; w_{\max}\right)

In words: the position weight "w sub t" — your size, as a multiple of one normal unit — is the smaller of two numbers (that's what "min" picks): the target vol divided by the current vol forecast, or a hard cap "w max." The hat on σ^t\hat{\sigma}_t ("sigma-hat sub t") marks it as an estimate — your EWMA forecast, not the unknowable true vol.

Worked example: target 10% annualized (a per-year vol figure), and the EWMA forecast says the asset currently runs 20% — the ratio is 10/20, so hold half a unit. Forecast drops to 5% — the raw ratio says 2×, and the cap decides whether you take it. The cap is not decoration. Vol forecasts are smallest exactly when markets are eerily calm — often right before they aren't. Volatility clusters, but regime breaks arrive unannounced (D1-10). An uncapped vol targeter maximizes leverage at the worst possible moment. Sized this way, dollar risk stays roughly constant across regimes. That stabilizes realized Sharpe and — critically — keeps one wild month from dominating a year's P&L.

Try it

▮ EXERCISE · d1-08-ex1

Implement ewma_var(returns, lam, initial_var): array same length as returns with var[0] = initial_var and var[t] = lam*var[t-1] + (1-lam)*returns[t-1]**2. And vol_target_weight(target_vol, forecast_vol, cap): the position weight min(target_vol/forecast_vol, cap).

⧉ Review card
Write the EWMA variance recursion and its relation to GARCH(1,1).
var[t] = lam*var[t-1] + (1-lam)*r[t-1]^2. It is GARCH(1,1) with omega = 0 and alpha + beta = 1: no long-run anchor, no mean reversion, one parameter. RiskMetrics standard: lam = 0.94 for daily data.
⧉ Review card
What is the effective lookback of EWMA with lam = 0.94?
Roughly 1/(1-lam) = 1/0.06, about 17 days. Higher lam means longer, smoother memory; lower lam means twitchier and more reactive.
⧉ Review card
What is the echo problem with rolling-window vol, and how does EWMA avoid it?
A crash day carries full weight for exactly N days, then drops out all at once — the vol estimate cliff-drops on the anniversary with no new news. EWMA weights decay geometrically, so shocks fade smoothly and it also reacts faster on day one.
⧉ Review card
State the vol-targeting position rule and the worked example.
weight = min(target_vol / forecast_vol, cap). Target 10 percent annualized with a 20 percent forecast: half size. The cap matters most when forecasts are lowest — calm markets are when uncapped leverage peaks, right before it hurts.

Draw it

On paper, sketch the step response: x-axis is days, one crash on day 0 in an otherwise flat series. Draw two curves of estimated vol — a 20-day rolling std and an EWMA — through day 30. Mark three features: which jumps higher on day 1, the rolling estimate's cliff at day 20, and the EWMA's smooth decay. Label the echo.

Predict before the next lesson

Next is D1-09: cointegration and pairs trading — where we finally hunt mean reversion not in one series but in the gap between two. Predict: two stocks have daily return correlation 0.9. Does that guarantee the ratio of their prices stays bounded over ten years? Sketch why or why not before reading.

◈ Calibration check

Could you implement EWMA vol from memory, explain the echo to a teammate with a sketch, and size a position given a target vol, a forecast, and a cap?

1 = guessing · 5 = could teach it

⏻ End of lesson

Mark it read to book its 4 review cards into your deck.

Sources & further reading