QTQuant 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 (ω=0\omega = 0) and force persistence to exactly one (α+β=1\alpha + \beta = 1, writing β=λ\beta = \lambda). What's left is the 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

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 the name — today's variance is a weighted sum of all past squared returns with weights (1λ)λk(1-\lambda)\lambda^k decaying geometrically. Yesterday matters most; last month whispers; last year is gone.

What you give up versus full GARCH: because α+β=1\alpha + \beta = 1, there is no unconditional variance (ω/(1αβ)\omega / (1 - \alpha - \beta) divides by zero — the answer to D1-07's closing prediction) and hence no mean reversion. EWMA's forecast for every future horizon is just 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 — no three-parameter fit to go wrong, no unstable ω\omega — usually wins.

Effective lookback: about 17 days

A geometric decay has no hard cutoff, 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}

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 — the same tension as choosing a rolling window length, minus the cliff.

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:

Faster reaction and graceful forgetting for one parameter is why EWMA is the practical default. One upgrade worth knowing exists: realized volatility built from higher-frequency (e.g. 5-minute) returns estimates each single day's variance far more precisely and is the modern research standard — we only wave at it here, since daily bars are what you have from free data.

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)

Worked example: target 10% annualized, EWMA forecast says the asset currently runs 20% — 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, which 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