Quant Memo
Core

The Chi-Squared Distribution

What you get when you square and sum independent standard normals — the distribution behind sample variance, goodness-of-fit tests, and confidence intervals on volatility itself.

Prerequisites: The Normal Distribution, Expectation, Variance & Moments

You estimate a stock's daily volatility from 30 trading days of returns. That estimate is itself a random number — a different 30 days would give a slightly different volatility estimate. How much slack should you put around it? Answering that requires knowing the distribution of a sum of squared normal deviations — which is exactly what the chi-squared distribution is built to describe.

The analogy: total distance from the bullseye, across many darts

Imagine throwing kk darts at a target, where each dart's horizontal miss and vertical miss are independent, standard-normal-sized errors. If you square each individual miss distance and add them all up across kk throws, the total is chi-squared distributed with kk "degrees of freedom." It measures accumulated squared error from a bunch of independent, zero-centered noise sources — which is precisely the situation you're in every time you compute a sample variance: you're summing squared deviations from a mean.

Writing it down

If Z1,,ZkZ_1, \ldots, Z_k are independent standard normal random variables, then

X=Z12+Z22++Zk2    χk2.X = Z_1^2 + Z_2^2 + \cdots + Z_k^2 \;\sim\; \chi^2_k.

In words: the chi-squared distribution with kk degrees of freedom is exactly the distribution of a sum of kk squared independent standard normals. It has mean kk and variance 2k2k — each squared standard normal contributes 1 to the mean and 2 to the variance on average, so both scale linearly with how many you add. The connection to sample variance: if S2S^2 is the sample variance of nn i.i.d. normal observations,

(n1)S2σ2χn12.\frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1}.

In words: take your sample variance, rescale it by the true variance and by (n1)(n-1), and the result follows a chi-squared distribution with n1n-1 degrees of freedom — which is the entire basis for building a confidence interval on volatility itself, not just on the mean.

Distribution · normal
-2.000.002.00μvalue →
Within ±1σ 68.3%mean μ 0.00std σ 1.00

Picture squaring every draw from this curve and summing kk of them: with k=1k=1 the result piles up near zero with a long right tail (a single squared normal is usually small, occasionally large); as kk grows the sum's distribution shifts right and becomes more symmetric — the chi-squared distribution's shape moving from heavily skewed toward roughly normal as degrees of freedom increase.

Worked example 1: confidence interval on volatility

You compute a daily return standard deviation of S=1.2%S = 1.2\% from n=30n=30 days. Using χ292\chi^2_{29}, the 2.5th and 97.5th percentiles are roughly 16.05 and 45.72 (standard table values). A 95% confidence interval for σ2\sigma^2 is

((n1)S245.72,(n1)S216.05)=(29(1.44)45.72,29(1.44)16.05)=(0.914,2.603).\left(\frac{(n-1)S^2}{45.72}, \frac{(n-1)S^2}{16.05}\right) = \left(\frac{29(1.44)}{45.72}, \frac{29(1.44)}{16.05}\right) = (0.914, 2.603).

Taking square roots, σ\sigma lies in roughly (0.96%,1.61%)(0.96\%, 1.61\%) with 95% confidence — a genuinely wide band from only 30 days of data, illustrating how noisy short-window volatility estimates really are.

Worked example 2: a goodness-of-fit check

A model predicts trades should split 40/35/25 across three venues. Over 200 trades, you observe 95, 65, 40. The chi-squared goodness-of-fit statistic sums (observedexpected)2/expected(observed - expected)^2/expected across categories: expected counts are 80,70,5080, 70, 50.

(9580)280+(6570)270+(4050)250=22580+2570+10050=2.81+0.36+2.00=5.17.\frac{(95-80)^2}{80} + \frac{(65-70)^2}{70} + \frac{(40-50)^2}{50} = \frac{225}{80} + \frac{25}{70} + \frac{100}{50} = 2.81 + 0.36 + 2.00 = 5.17.

With 2 degrees of freedom (3 categories minus 1), the 95th percentile of χ22\chi^2_2 is 5.99. Since 5.17<5.995.17 < 5.99, you fail to reject the model — the deviation, while visible, is within what random noise alone would produce.

Function explorer
-224.4
x = 1.00f(x) = 1.000

Try a low positive exponent here — that rising-then-flattening shape mirrors a chi-squared density with few degrees of freedom: a fast climb from zero followed by a long decaying tail, which flattens toward something more symmetric as degrees of freedom (like exponent here) increase.

What this means in practice

  • Volatility confidence intervals. Any time you report a realized volatility number, the chi-squared distribution is what tells you how much to trust it, especially with short lookback windows.
  • Goodness-of-fit and independence tests. Checking whether observed trade routing, defaults, or category counts match a model's prediction routinely uses a chi-squared test statistic.
  • Building block for other distributions. The tt-distribution and FF-distribution, both central to regression inference, are constructed directly from ratios involving chi-squared variables.

The chi-squared distribution with kk degrees of freedom is the distribution of a sum of kk squared independent standard normals — it's the natural distribution of squared deviations, which is why it governs the uncertainty in any estimated variance.

Degrees of freedom is not "sample size" — it's sample size minus the number of parameters already estimated from the same data (like the mean, when computing sample variance). Using nn instead of n1n-1 degrees of freedom in the volatility confidence interval above silently understates the true uncertainty, because you spent one degree of freedom estimating the mean before computing the deviations.

Related concepts

Practice in interviews

Further reading

  • Casella, Berger, Statistical Inference (ch. 5)
  • Wasserman, All of Statistics (ch. 5)
ShareTwitterLinkedIn