Skip to content
LeetQuant
E10 Volatility Forecasting

E10 · Volatility Forecasting · Lesson 1 of 4

Realised Volatility

Realised variance from intraday returns and why it converges to integrated variance, the sampling-frequency trade-off against microstructure noise, range-based estimators (Parkinson, Garman–Klass) and their efficiency, and correct annualisation.

18 min

Objective

Every volatility forecast has to be scored against something, and the true variance of a day is never observed. This lesson is about measuring volatility after the fact as precisely as possible: realised variance from intraday data, what goes wrong when you sample too often, how to squeeze more out of daily open/high/low/close bars, and how to annualise without bias. The GARCH lesson in Time Series treated the squared daily return as the proxy; here we see how bad that proxy is and how to do better.

Realised variance

Let the log price follow dpt=μt dt+σt dWtdp_t = \mu_t\,dt + \sigma_t\,dW_t. The quantity we want for day tt is the integrated variance

IVt=∫t−1tσs2 ds.\text{IV}_t = \int_{t-1}^{t} \sigma_s^2\,ds .

Split the day into nn intervals and take the intraday log returns rt,ir_{t,i}. Realised variance is

RVt(n)=∑i=1nrt,i2  →  n→∞    IVt,\text{RV}_t^{(n)} = \sum_{i=1}^{n} r_{t,i}^2 \;\xrightarrow{\;n \to \infty\;}\; \text{IV}_t ,

the quadratic variation of the log price. The drift does not matter: its contribution to each return is O(1/n)O(1/n), so to each squared return O(1/n2)O(1/n^2), and the sum is O(1/n)O(1/n).

How precise is it? With constant volatility, each intraday return is N(0,σ2/n)N(0, \sigma^2/n), so rt,i2r_{t,i}^2 has mean σ2/n\sigma^2/n and variance 2σ4/n22\sigma^4/n^2. Summing nn independent terms:

E[RV(n)]=σ2,sd⁡(RV(n))σ2=2n.\mathbb{E}\big[\text{RV}^{(n)}\big] = \sigma^2, \qquad \frac{\operatorname{sd}\big(\text{RV}^{(n)}\big)}{\sigma^2} = \sqrt{\frac{2}{n}} .

With n=1n = 1 (the squared close-to-close return) the relative error is 2≈141%\sqrt 2 \approx 141\%: the proxy is unbiased but almost useless for a single day. With 78 five-minute returns in a 6.5-hour session it is 2/78≈16%\sqrt{2/78} \approx 16\%. With stochastic volatility the formula becomes Var⁡≈2n∫σs4 ds\operatorname{Var} \approx \tfrac{2}{n}\int\sigma_s^4\,ds (integrated quarticity), but the 1/n1/n rate is the same.

Microstructure noise

The infinite-sampling limit breaks on real data. Observed prices are the efficient price plus noise from the bid–ask bounce, discreteness and stale quotes: p~t,i=pt,i+ut,i\tilde p_{t,i} = p_{t,i} + u_{t,i} with uu i.i.d., mean 0, variance η2\eta^2. Observed returns are then

r~t,i=rt,i+ut,i−ut,i−1,\tilde r_{t,i} = r_{t,i} + u_{t,i} - u_{t,i-1},

which have negative first-order autocorrelation (the bounce) and an extra variance of 2η22\eta^2 each. Summing nn of them,

E[RV~(n)]=IV+2nη2.\mathbb{E}\big[\widetilde{\text{RV}}^{(n)}\big] = \text{IV} + 2n\eta^2 .

The signal is fixed while the noise grows linearly in nn: sample every tick and you measure the spread, not the volatility. Keeping the leading terms, the mean squared error is

MSE(n)≈2σ4n+(2nη2)2,\text{MSE}(n) \approx \frac{2\sigma^4}{n} + \big(2n\eta^2\big)^2 ,

minimised where −2σ4/n2+8nη4=0-2\sigma^4/n^2 + 8n\eta^4 = 0:

n∗≈(σ44η4)1/3.n^* \approx \left(\frac{\sigma^4}{4\eta^4}\right)^{1/3} .

In practice people plot average RV against sampling interval (the volatility signature plot), and pick the interval where the curve flattens; 5 minutes is the conventional default for liquid stocks. Better still are estimators that use all the data and remove the noise: subsampling and averaging (two-scale RV), realised kernels that add back the autocovariances of returns, and pre-averaging. All of them exploit the same fact: noise shows up as negative autocorrelation of high-frequency returns.

Worked example

the best sampling frequency

A stock has daily volatility 1% (σ2=10−4\sigma^2 = 10^{-4}) and microstructure noise with standard deviation 5 basis points (η2=2.5×10−7\eta^2 = 2.5 \times 10^{-7}). The session is 390 minutes. What is the expected RV from 1-minute and from 5-minute returns? Roughly what sampling interval minimises the MSE, and how precise is RV there?

Show solution

Bias. With 1-minute returns, n=390n = 390 and the bias is 2×390×2.5×10−7=1.95×10−42 \times 390 \times 2.5 \times 10^{-7} = 1.95 \times 10^{-4}, so the expected RV is 2.95×10−42.95 \times 10^{-4}: nearly three times the true variance, a "volatility" of 1.72%1.72\% instead of 1%1\%. With 5-minute returns, n=78n = 78 and the bias is 3.9×10−53.9 \times 10^{-5}: expected RV 1.39×10−41.39 \times 10^{-4}, still 39% too high.

Optimum. n∗=(10−8/(4×6.25×10−14))1/3=(4×104)1/3≈34n^* = \big(10^{-8} / (4 \times 6.25 \times 10^{-14})\big)^{1/3} = (4 \times 10^{4})^{1/3} \approx 34 returns, one every 390/34≈11390/34 \approx 11 minutes.

Precision there. Bias 2×34×2.5×10−7=1.7×10−52 \times 34 \times 2.5 \times 10^{-7} = 1.7 \times 10^{-5} and standard deviation 2/34×10−4=2.43×10−5\sqrt{2/34} \times 10^{-4} = 2.43 \times 10^{-5}, so the RMSE is 1.72+2.432×10−5≈2.96×10−5\sqrt{1.7^2 + 2.43^2} \times 10^{-5} \approx 2.96 \times 10^{-5}, about 30% of σ2\sigma^2. Compare 141% for the squared daily return.

A simulation of this exact setup (20,000 days) agrees: RMSE about 33% of σ2\sigma^2 for 10–15 minute sampling, against 45% at 5 minutes and 196% at 1 minute. The approximation slightly understates the error because it drops the variance contributed by the noise itself. Note how flat the curve is near the optimum: anything from 8 to 20 minutes is within about 6% of the best RMSE.

Range-based estimators

Without intraday data you usually still have the open, high, low and close. The range carries much more information than the close alone, because the path had to visit both extremes. Write o,h,l,co, h, l, c for log prices, with o=0o = 0 by convention.

Parkinson (1980). For Brownian motion without drift, E[(h−l)2]=4ln⁡2 σ2\mathbb{E}\big[(h - l)^2\big] = 4\ln 2\,\sigma^2, so

σ^P2=(h−l)24ln⁡2.\hat\sigma^2_{P} = \frac{(h - l)^2}{4 \ln 2} .

Its variance is about 0.407σ40.407\sigma^4, against 2σ42\sigma^4 for c2c^2: an efficiency (variance ratio) of about 4.94.9. One day of ranges is worth about five days of closes.

Garman–Klass (1980). Combine the range with the open-to-close return:

σ^GK2=12(h−l)2−(2ln⁡2−1) c2,\hat\sigma^2_{GK} = \tfrac12 (h - l)^2 - (2\ln 2 - 1)\,c^2 ,

with efficiency about 7.47.4. The subtracted term corrects for the part of the range already explained by the net move.

Rogers–Satchell stays unbiased under a non-zero drift, σ^RS2=h(h−c)+l(l−c)\hat\sigma^2_{RS} = h(h - c) + l(l - c), and Yang–Zhang adds the overnight (close-to-open) return, which none of the others see.

Failure modes. All range estimators assume continuous monitoring. Real prices trade discretely, so the observed high is below the true high and the observed low above the true low: range estimators are biased downward, more so for illiquid names. Bid–ask bounce pushes the other way (the high tends to be an ask and the low a bid). Jumps at the open and the overnight gap are missed entirely. And the efficiency figures are for constant intraday volatility; the U-shaped intraday pattern changes them.

Worked example

estimators from one daily bar

A stock opens at 100, trades between 98 and 103, and closes at 101. Estimate the day's variance using the close-to-close return (assume the previous close was 100), Parkinson and Garman–Klass, and annualise each.

Show solution

Log quantities: h−l=ln⁡(103/98)=0.04976h - l = \ln(103/98) = 0.04976, so (h−l)2=0.002476(h - l)^2 = 0.002476; c=ln⁡1.01=0.00995c = \ln 1.01 = 0.00995, so c2=9.90×10−5c^2 = 9.90 \times 10^{-5}.

  • Close-to-close: σ^2=9.90×10−5\hat\sigma^2 = 9.90 \times 10^{-5}, volatility 0.995%0.995\%, annualised 0.995%×252=15.8%0.995\% \times \sqrt{252} = 15.8\%.
  • Parkinson: 0.002476/(4ln⁡2)=0.002476/2.7726=8.93×10−40.002476 / (4 \ln 2) = 0.002476 / 2.7726 = 8.93 \times 10^{-4}, volatility 2.99%2.99\%, annualised 47.4%47.4\%.
  • Garman–Klass: 0.5×0.002476−0.3863×9.90×10−5=0.001238−0.000038=0.001200.5 \times 0.002476 - 0.3863 \times 9.90 \times 10^{-5} = 0.001238 - 0.000038 = 0.00120, volatility 3.46%3.46\%, annualised 55.0%55.0\%.

The close says "quiet day"; the range says the stock moved 5% intraday and came back. Any single-day estimate is noisy, but the range estimators are telling you something the close cannot. Over many days, all three are estimating the same variance; the range-based ones just get there with far fewer observations.

A simulation you can run

The script simulates 20,000 days of a Brownian log price with 1% daily volatility on a one-minute grid, adds 5bp of i.i.d. noise to the observed prices, and compares estimators by their mean and RMSE relative to the true variance. The range estimators use the efficient (noise-free) minute prices, so they show only the discrete-monitoring effect.

import numpy as np

rng = np.random.default_rng(3)
days, n, sigma, eta = 20_000, 390, 0.01, 0.0005   # 1% daily vol, 5bp noise

# efficient log price: Brownian motion sampled every minute, starting at 0
steps = rng.normal(0, sigma / np.sqrt(n), (days, n))
p = np.concatenate([np.zeros((days, 1)), steps.cumsum(axis=1)], axis=1)
obs = p + rng.normal(0, eta, p.shape)              # what the tape shows

def rv(x, k):                                      # realised variance, every k minutes
    return (np.diff(x[:, ::k], axis=1) ** 2).sum(axis=1)

o, c = p[:, 0], p[:, -1]
hl = p.max(axis=1) - p.min(axis=1)
est = {
    "close-to-close r^2": (c - o) ** 2,
    "Parkinson":          hl**2 / (4 * np.log(2)),
    "Garman-Klass":       0.5 * hl**2 - (2 * np.log(2) - 1) * (c - o) ** 2,
    "RV 5-min, no noise": rv(p, 5),
    "RV 5-min, noisy":    rv(obs, 5),
    "RV 1-min, noisy":    rv(obs, 1),
}
print(f"{'estimator':20s} {'mean/true':>9s} {'RMSE/true':>10s}")
for name, e in est.items():
    print(f"{name:20s} {e.mean() / sigma**2:9.3f} {np.sqrt(((e - sigma**2) ** 2).mean()) / sigma**2:10.3f}")

Output:

estimator            mean/true  RMSE/true
close-to-close r^2       1.003      1.417
Parkinson                0.933      0.623
Garman-Klass             0.906      0.500
RV 5-min, no noise       1.000      0.160
RV 5-min, noisy          1.390      0.451
RV 1-min, noisy          2.949      1.963

Read it line by line against the theory:

  • Close-to-close: unbiased, RMSE ≈2\approx \sqrt 2.
  • Parkinson and Garman–Klass: RMSE near the continuous-monitoring values 0.407=0.64\sqrt{0.407} = 0.64 and 2/7.4=0.52\sqrt{2/7.4} = 0.52, but biased down 7–9% because a 390-step grid misses the true extremes.
  • Clean 5-minute RV: unbiased with RMSE 2/78=0.160\sqrt{2/78} = 0.160, the best here by far.
  • Noisy RV: the bias 2nη2/σ22n\eta^2/\sigma^2 is 0.390.39 at 5 minutes and 1.951.95 at 1 minute, exactly as derived. Sampling more often made the estimate worse.

Annualisation

Variance, not volatility, scales with time (for uncorrelated returns). So:

  • Annual variance =252×= 252 \times average daily variance; annual volatility =252×average daily variance= \sqrt{252} \times \sqrt{\text{average daily variance}}, with 252≈15.87\sqrt{252} \approx 15.87.
  • Average variances, then take the root. Averaging daily volatilities understates volatility by Jensen's inequality, E[σ]≤E[σ2]\mathbb{E}[\sigma] \le \sqrt{\mathbb{E}[\sigma^2]}, and the gap widens exactly when volatility is volatile.
  • Mind the overnight return. RV over trading hours misses the close-to-open move, a substantial share of an equity's total daily variance. Either add the squared overnight return or scale intraday RV up to match the close-to-close variance over a long sample.
  • Mind the calendar. Use trading days for trading-day returns (252), calendar days if the series includes weekends, and remember that implied volatility is usually quoted on a calendar or business-day convention that may differ from yours.
  • If returns are autocorrelated (stale prices, illiquid assets), 252\sqrt{252} scaling is wrong; the variance of a sum includes the autocovariances.

Knowledge check

Under constant volatility and no noise, roughly how many equally spaced intraday returns are needed for realised variance to have a relative standard error of 10%?

Knowledge check

You switch a realised-volatility estimate from 5-minute to tick-by-tick returns on a stock with a wide bid–ask spread. What happens to the average estimate, and why?

Knowledge check

Four days have daily realised variances of 1, 1, 4 and 1 (in percent squared). What is the annualised volatility over the period?

Key takeaways

  • Realised variance ∑rt,i2\sum r_{t,i}^2 converges to integrated variance; its relative error is about 2/n\sqrt{2/n}, against 141% for one squared daily return.
  • Microstructure noise adds 2nη22n\eta^2 of bias, so there is an optimal frequency n∗≈(σ4/4η4)1/3n^* \approx (\sigma^4/4\eta^4)^{1/3}; use a signature plot, or noise-robust estimators (two-scale, realised kernels, pre-averaging).
  • Parkinson (≈4.9×\approx 4.9\times) and Garman–Klass (≈7.4×\approx 7.4\times) are far more efficient than close-to-close, but biased down by discrete monitoring and blind to overnight gaps.
  • Annualise variances, not volatilities; include the overnight return; average variances before taking roots.

Practice problems

Finished reading?

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