Skip to content
LeetQuant
E10 Volatility Forecasting

E10 · Volatility Forecasting · Lesson 4 of 4

Volatility Forecast Evaluation

Scoring volatility forecasts against noisy proxies: which loss functions rank forecasts correctly (MSE on variance and QLIKE) and which do not, Mincer–Zarnowitz regressions and their R² ceiling, Diebold–Mariano tests with HAC errors, and the common mistakes.

18 min

Objective

Comparing return forecasts is easy because the target is observed. Volatility forecasts are compared against a proxy for a quantity that is never observed, and the proxy is noisy: rt2r_t^2 has a 141% relative error, 5-minute RV perhaps 15–30%. This lesson answers three questions: which loss function still ranks forecasts correctly when the target is noisy, how to test whether a forecast is unbiased, and how to tell whether one forecast is genuinely better than another.

Notation: hth_t is the true conditional variance, σ^t2\hat\sigma_t^2 a forecast made at t−1t-1, and h^t\hat h_t a proxy with Et−1[h^t]=ht\mathbb{E}_{t-1}[\hat h_t] = h_t (conditionally unbiased), such as rt2r_t^2 or RV.

Loss functions robust to a noisy proxy

With the true hth_t every sensible loss ranks forecasts the same way in the limit. With a proxy, Patton (2011) showed that the ranking is preserved only for a specific family of losses. The two members everyone uses are

MSE: L=(h^−σ^2)2,QLIKE: L=h^σ^2−ln⁡h^σ^2−1.\text{MSE: } L = \big(\hat h - \hat\sigma^2\big)^2, \qquad \text{QLIKE: } L = \frac{\hat h}{\hat\sigma^2} - \ln\frac{\hat h}{\hat\sigma^2} - 1 .

The test of robustness is simple: for a fixed true hh, which forecast minimises the expected loss when the proxy is noisy? Any conditionally unbiased proxy gives:

  • MSE on variance: E[(h^−c)2]\mathbb{E}[(\hat h - c)^2] is minimised at c=E[h^]=hc = \mathbb{E}[\hat h] = h. Robust.
  • QLIKE: E[h^/c+ln⁡c]\mathbb{E}[\hat h/c + \ln c] has derivative −h/c2+1/c=0-h/c^2 + 1/c = 0 at c=hc = h. Robust.

Now the popular ones that are not robust, with proxy r2=hz2r^2 = h z^2 and z∼N(0,1)z \sim N(0, 1):

LossMinimising forecast ccBias
MSE on volatility, (∣r∣−c)2(\lvert r\rvert - \sqrt c)^2c=E∣r∣=0.798h\sqrt c = \mathbb{E}\lvert r\rvert = 0.798\sqrt hc=0.637hc = 0.637h
MAE on variance, ∣r2−c∣\lvert r^2 - c\rvertmedian of r2r^2c=0.455hc = 0.455h
MSE on log variance, (ln⁡r2−ln⁡c)2(\ln r^2 - \ln c)^2exp⁡Eln⁡r2\exp\mathbb{E}\ln r^2c=0.281hc = 0.281h

(Using E∣z∣=2/π\mathbb{E}|z| = \sqrt{2/\pi}, the median of χ12\chi^2_1 of 0.4550.455, and Eln⁡z2=−γE−ln⁡2=−1.270\mathbb{E}\ln z^2 = -\gamma_E - \ln 2 = -1.270.) Each of these rewards a forecast that is systematically too low, and the less precise the proxy, the bigger the reward. With RV the biases shrink but do not vanish.

MSE versus QLIKE. Both are valid; they weight errors differently. MSE depends on the absolute error, so a handful of high-volatility days dominate it, and its estimates are noisy. QLIKE depends only on the ratio h^/σ^2\hat h/\hat\sigma^2, so every day counts equally, and it penalises under-prediction more than over-prediction, which matches the cost structure of risk management. QLIKE's tests usually have more power. Report both.

Worked example

QLIKE's asymmetry

The true variance is hh and the proxy is unbiased. Compare the expected excess loss (over the perfect forecast) of forecasting 0.5h0.5h and 2h2h, under QLIKE and under MSE on variance.

Show solution

QLIKE. E[L(c)]=h/c+ln⁡c−E[ln⁡h^]−1\mathbb{E}[L(c)] = h/c + \ln c - \mathbb{E}[\ln \hat h] - 1. Subtract the value at c=hc = h; writing c=khc = kh, the excess loss is 1/k+ln⁡k−11/k + \ln k - 1, independent of the level hh and of the proxy's noise.

  • k=0.5k = 0.5: 2−0.693−1=0.3072 - 0.693 - 1 = 0.307.
  • k=2k = 2: 0.5+0.693−1=0.1930.5 + 0.693 - 1 = 0.193.

Forecasting half the variance costs about 60% more than forecasting double. For risk use, under-predicting volatility is the expensive error, and QLIKE agrees.

MSE on variance. The excess is (c−h)2=h2(1−k)2(c - h)^2 = h^2(1 - k)^2: 0.25h20.25h^2 for k=0.5k = 0.5 and 1.00h21.00h^2 for k=2k = 2. MSE punishes over-prediction four times harder here, and the loss scales with h2h^2, so the same proportional error on a high-volatility day counts many times more.

Mincer–Zarnowitz regressions

A forecast is conditionally unbiased if Et−1[h^t]=σ^t2\mathbb{E}_{t-1}[\hat h_t] = \hat\sigma_t^2. Test it by regressing the proxy on the forecast:

h^t=a+b σ^t2+et,H0:a=0, b=1,\hat h_t = a + b\,\hat\sigma_t^2 + e_t, \qquad H_0: a = 0,\ b = 1 ,

a joint Wald test with HAC standard errors (the errors are heteroscedastic, and serially correlated if horizons overlap). Because the proxy is on the left-hand side, its noise only inflates the residual variance; it does not bias aa or bb. Noise in the forecast would bias bb toward zero, but the forecast is what it is.

Do not read the R2R^2 as a quality score. Even the true variance has a low R2R^2 against r2r^2. With σ^2=h\hat\sigma^2 = h exactly,

Rmax⁡2=Var⁡(h)Var⁡(r2)=Var⁡(h)3 E[h2]−(Eh)2R^2_{\max} = \frac{\operatorname{Var}(h)}{\operatorname{Var}(r^2)} = \frac{\operatorname{Var}(h)}{3\,\mathbb{E}[h^2] - (\mathbb{E}h)^2}

for normal shocks. If hh has mean 1 and standard deviation 0.5, E[h2]=1.25\mathbb{E}[h^2] = 1.25 and Rmax⁡2=0.25/(3.75−1)=0.091R^2_{\max} = 0.25/(3.75 - 1) = 0.091. A perfect forecast "explains" 9% of the variation in squared returns. With 5-minute RV as the proxy (relative noise variance 2/782/78), the same perfect forecast reaches R2=0.25/(1.25×1.0256−1)=0.89R^2 = 0.25/(1.25 \times 1.0256 - 1) = 0.89. The claim "volatility forecasts are useless, R2R^2 is only 5%" is a statement about the proxy.

Variants: regress in logs (more robust to outliers, but not a test of unbiasedness for the level) or add a competing forecast as a second regressor (encompassing): if the competitor's coefficient is significant, your forecast is missing information it contains.

Diebold–Mariano tests

To compare forecasts A and B, form the loss differential dt=L(h^t,σ^A,t2)−L(h^t,σ^B,t2)d_t = L(\hat h_t, \hat\sigma^2_{A,t}) - L(\hat h_t, \hat\sigma^2_{B,t}) and test E[dt]=0\mathbb{E}[d_t] = 0:

DM=dˉLRV^(d)/T  ≈  N(0,1),\text{DM} = \frac{\bar d}{\sqrt{\widehat{\text{LRV}}(d)/T}} \;\approx\; N(0, 1) ,

where LRV^\widehat{\text{LRV}} is a Newey–West estimate of the long-run variance of dtd_t. Points to know:

  • The loss must be robust (MSE or QLIKE). Otherwise DM can significantly prefer the wrong forecast.
  • Serial correlation. Loss differentials of volatility forecasts are autocorrelated (volatility clusters), and hh-step forecasts with overlapping horizons have MA(h−1h-1) errors by construction. Use at least h−1h - 1 Newey–West lags.
  • Nested models. Comparing a model with a restricted version of itself (HAR against AR(1) in RV, GJR against GARCH) makes the DM statistic non-normal under the null. Use the Clark–West adjustment, or the Giacomini–White framework, which tests forecasting methods (including the estimation window) rather than population models.
  • Many models. Testing ten models against a benchmark and reporting the best is data snooping; use a model confidence set or a reality-check style test.

Worked example

is the improvement significant?

Over T=1,000T = 1{,}000 days, the QLIKE loss differential (benchmark minus new model) has mean 0.0150.015, standard deviation 0.300.30 and first-order autocorrelation 0.250.25, with negligible higher-order autocorrelation. Compute the DM statistic with one Newey–West lag, and without any HAC correction.

Show solution

With one lag, the Bartlett weight is 1−1/2=0.51 - 1/2 = 0.5, so LRV^=γ0+2×0.5×γ1=γ0(1+ρ1)=0.09×1.25=0.1125\widehat{\text{LRV}} = \gamma_0 + 2 \times 0.5 \times \gamma_1 = \gamma_0(1 + \rho_1) = 0.09 \times 1.25 = 0.1125.

DM=0.0150.1125/1000=0.0150.01061≈1.41.\text{DM} = \frac{0.015}{\sqrt{0.1125/1000}} = \frac{0.015}{0.01061} \approx 1.41 .

Not significant at 5% (1.961.96 two-sided, 1.6451.645 one-sided). Without the correction, DM=0.015/0.09/1000=0.015/0.00949≈1.58\text{DM} = 0.015/\sqrt{0.09/1000} = 0.015/0.00949 \approx 1.58: still not significant, but closer, and with more autocorrelation the naive statistic can cross the line when the correct one does not. A full Newey–West weight on γ1\gamma_1 (a longer lag window) would give γ0(1+2ρ1)\gamma_0(1 + 2\rho_1) and DM≈1.29\text{DM} \approx 1.29.

Everything at once, in simulation

Simulate a GARCH(1,1) in percent returns, then score three forecasts against the noisy proxy r2r^2: the true conditional variance, an EWMA, and a forecast deliberately shrunk to 0.640.64 times the truth (close to the MSE-on-volatility optimum 2/π2/\pi).

import numpy as np

rng = np.random.default_rng(11)
T, omega, alpha, beta = 5000, 0.02, 0.08, 0.90       # returns in %, long-run variance 1
h, r = np.empty(T), np.empty(T)
h[0] = 1.0
for t in range(T):
    r[t] = np.sqrt(h[t]) * rng.standard_normal()
    if t + 1 < T:
        h[t + 1] = omega + alpha * r[t] ** 2 + beta * h[t]

ewma = np.empty(T); ewma[0] = 1.0
for t in range(1, T):
    ewma[t] = 0.94 * ewma[t - 1] + 0.06 * r[t - 1] ** 2

proxy = r**2                                         # noisy, unbiased proxy for h
losses = {
    "MSE on variance": lambda f: (proxy - f) ** 2,
    "QLIKE":           lambda f: proxy / f - np.log(proxy / f) - 1,
    "MSE on vol":      lambda f: (np.sqrt(proxy) - np.sqrt(f)) ** 2,
}
forecasts = {"true h": h, "EWMA": ewma, "0.64 x true h": 0.64 * h}
print(f"{'':16s}" + "".join(f"{k:>15s}" for k in forecasts))
for name, L in losses.items():
    print(f"{name:16s}" + "".join(f"{L(f).mean():15.4f}" for f in forecasts.values()))

def dm_stat(d, lags):
    """Diebold-Mariano t-stat with a Newey-West (Bartlett) long-run variance."""
    u = d - d.mean()
    lrv = u @ u / len(u)
    for k in range(1, lags + 1):
        lrv += 2 * (1 - k / (lags + 1)) * (u[k:] @ u[:-k]) / len(u)
    return d.mean() / np.sqrt(lrv / len(d))

d = losses["QLIKE"](ewma) - losses["QLIKE"](h)       # positive: EWMA is worse
print(f"DM (EWMA vs true h, QLIKE): {dm_stat(d, 5):.2f}")

for name in ["true h", "EWMA"]:                     # Mincer-Zarnowitz: r^2 on forecast
    X = np.column_stack([np.ones(T), forecasts[name]])
    b, *_ = np.linalg.lstsq(X, proxy, rcond=None)
    r2 = 1 - np.mean((proxy - X @ b) ** 2) / proxy.var()
    print(f"MZ {name:7s} a = {b[0]:.3f}, b = {b[1]:.3f}, R^2 = {r2:.3f}")

Output:

                         true h           EWMA  0.64 x true h
MSE on variance          2.4125         2.4359         2.5404
QLIKE                    1.2799         1.2925         1.3955
MSE on vol               0.3940         0.3961         0.3514
DM (EWMA vs true h, QLIKE): 3.78
MZ true h  a = 0.083, b = 0.902, R^2 = 0.087
MZ EWMA    a = 0.199, b = 0.790, R^2 = 0.082

What it shows:

  • MSE on volatility ranks the deliberately biased forecast first, ahead of the truth. The two robust losses rank the truth first.
  • QLIKE separates the truth from EWMA decisively (DM 3.78). The same comparison under MSE on variance gives a DM of about 2.2 on this sample: same ranking, less power, because a few high-variance days dominate the squared errors.
  • Mincer–Zarnowitz with the true variance gives b=0.90b = 0.90 and R2=0.087R^2 = 0.087. The slope is within sampling error of 1 (other seeds give 0.90–1.05) and the R2R^2 is at its ceiling: low, and not a sign of a bad forecast. EWMA's lower slope and positive intercept are the signature of a forecast that does not mean-revert: when it is high it is too high, when low too low.

Common mistakes

  • Scoring volatility instead of variance, or using MAE or log errors: these reward under-forecasting under a noisy proxy.
  • Using the noisiest proxy available. With intraday data, use RV (including the overnight return, or matching the forecast's window), not r2r^2; the rankings are the same in expectation but the tests have far more power.
  • Mismatched windows and units. A forecast of close-to-close variance scored against open-to-close RV looks biased low. Annualisation conventions (252 versus 365, trading versus calendar days) must match between forecast and proxy.
  • Look-ahead. The forecast for day tt must use data up to t−1t-1; a rolling RV that includes day tt, or parameters fitted on the full sample, leaks the target.
  • Ignoring overlap. Monthly forecasts made daily give 21-day overlapping errors; naive standard errors are far too small.
  • Reading the MZ R2R^2 as accuracy, or rejecting b=1b = 1 because of a few extreme days without robust standard errors.
  • Testing nested models with plain DM, or picking the best of many models and testing it as if it had been chosen in advance.
  • Evaluating only in calm periods. A model that under-reacts looks fine until the first crisis; check performance in high-volatility subsamples separately.

Knowledge check

You score volatility forecasts by the mean squared error between the forecast volatility and the absolute daily return. Which forecast minimises the expected loss, if returns are conditionally normal?

Knowledge check

A Mincer–Zarnowitz regression of daily squared returns on your variance forecast gives a = 0.01, b = 0.97 and R² = 0.07. What is the right conclusion?

Knowledge check

You compare 21-day variance forecasts made every day against realised variance over the following 21 days, using a Diebold–Mariano test. What must you do differently from a one-day-ahead comparison?

Key takeaways

  • With a conditionally unbiased proxy, only some losses rank forecasts correctly: use MSE on variance and QLIKE; MSE on volatility, MAE and log losses reward forecasts that are too low.
  • QLIKE depends on the ratio of proxy to forecast, penalises under-prediction more, and usually gives more powerful tests than MSE.
  • Mincer–Zarnowitz tests a=0,b=1a = 0, b = 1; its R2R^2 is capped by proxy noise (about 9% for a perfect forecast against r2r^2 in a typical case) and is not a quality score.
  • Diebold–Mariano on loss differentials needs HAC errors (at least h−1h-1 lags for overlapping horizons), robust losses, and different tools for nested models or many models.

Practice problems

Finished reading?

Answer the 3 knowledge checks to complete this lesson (0 done).