Section 15.45

Central limit theorem

Definition

The central limit theorem (CLT) is a theorem of probability theory about averages. Take independent observations that all follow one probability distribution with a finite, positive variance §11.14, the average squared distance from the mean. As their number grows, the distribution of their average, centered on the true mean and divided by its standard error §11.15 (the standard deviation of the average), approaches the standard normal distribution: the symmetric bell curve with mean 0 and standard deviation 1. The theorem describes a limit; it does not say how many observations are enough.

The idea

Single response times §9.32 are usually skewed: most are short, and a few are very long. Yet the average of 1000 response times, recomputed on fresh data many times, varies in a narrow, nearly symmetric, bell-shaped way. That is why the recipe ‘mean plus or minus 1.96 standard errors’ gives an approximate 95% confidence interval §11.18 for a large sample even when the data themselves are far from bell-shaped.

Dice show the mechanism. One die gives each value from 1 to 6 with probability 1/61/6: a flat distribution. The sum of two dice is no longer flat. A sum of 7 arises in 6 of the 36 equally likely ways, and 2 and 12 in one way each. With more dice, the middle sums arise in far more ways than the extreme ones, because an extreme sum needs every die to be extreme in the same direction, while a middle sum lets high and low values offset each other. The shape of the sum becomes a bell. The CLT says that this happens for sums of independent observations from any distribution with a finite, positive variance, and that the limiting bell is always the same normal curve once the sum is centered and scaled.

How it works

Write X1,…,XnX_1, \dots, X_n for nn observations and X‾n=(X1+…+Xn)/n\bar X_n = (X_1 + \dots + X_n)/n for their sample mean §11.12.

  1. Assume a model. The basic theorem assumes that the observations are independent and identically distributed §11.5 (IID): learning any subset of the readings leaves the joint probabilities for the remaining readings unchanged, and each reading follows the same distribution with mean μ\mu and standard deviation σ\sigma, where 0<σ<∞0 < \sigma < \infty.

  2. Exact facts for every nn. With these assumptions, the sample mean has mean μ\mu and standard deviation σ/n\sigma/\sqrt n, its standard error. These two facts need no limit.

  3. Standardize. Subtract the mean and divide by the standard error: Zn=(X‾n−μ)/(σ/n)=n(X‾n−μ)/σZ_n = (\bar X_n - \mu)/(\sigma/\sqrt n) = \sqrt n\,(\bar X_n - \mu)/\sigma. For every nn, ZnZ_n has mean 0 and standard deviation 1.

  4. Take the limit. The CLT states that the shape of the distribution of ZnZ_n approaches the standard normal shape as nn grows.

  5. Use it as an approximation. At a finite nn, one acts as if ZnZ_n were exactly standard normal. A standard normal value lies between −1.96-1.96 and 1.961.96 with probability 0.95, which gives the interval X‾n±1.96σ/n\bar X_n \pm 1.96\,\sigma/\sqrt n; in practice σ\sigma is replaced by the sample standard deviation. How good the approximation is at the actual nn is a separate question, which the limit does not answer.

Other versions of the theorem allow observations with different distributions, provided that no single observation dominates the sum (the Lindeberg condition), or allow weak dependence between observations. Each version states its own conditions, and with dependence the variance of the mean also depends on how the observations vary together.

Worked example

An observation, in milliseconds, is 0 with probability 0.99 and 100 with probability 0.01, like a response time that is usually negligible but occasionally hits a long stall, a burst. Its mean is μ=0×0.99+100×0.01=1\mu = 0 \times 0.99 + 100 \times 0.01 = 1 ms. Its variance is E[X2]−μ2=1002×0.01−12=100−1=99ms2E[X^2] - \mu^2 = 100^2 \times 0.01 - 1^2 = 100 - 1 = 99\ \mathrm{ms}^2, where E[X2]E[X^2] is the probability-weighted average of the squared value. So σ=99≈9.95\sigma = \sqrt{99} \approx 9.95 ms, which is finite and positive: the CLT applies as nn grows.

Take n=30n = 30 observations, a size often quoted as large enough. The standard error is 9.95/30≈9.95/5.48≈1.829.95/\sqrt{30} \approx 9.95/5.48 \approx 1.82 ms. The sample mean depends only on the number of bursts KK in the sample: X‾30=100K/30\bar X_{30} = 100K/30. No burst has probability 0.9930≈0.7400.99^{30} \approx 0.740; exactly one burst has probability 30×0.01×0.9929≈0.22430 \times 0.01 \times 0.99^{29} \approx 0.224; exactly two, about 0.033. So the sample mean is exactly 0 ms in about 74% of samples, 3.33 ms in about 22% and 6.67 ms in about 3%. The normal approximation instead describes a smooth, symmetric spread around 1 ms. Let Φ(z)\Phi(z) be the probability that a standard normal value is at most zz. The approximation puts the sample mean at or below 0 with probability Φ((0−1)/1.82)=Φ(−0.55)≈0.29\Phi((0 - 1)/1.82) = \Phi(-0.55) \approx 0.29. The true probability is 0.74.

Because the sample mean is a fixed multiple of the burst count, the normal shape appears only as the expected number of bursts per sample, n×0.01n \times 0.01, grows: it is 0.3 at n=30n = 30 and 10 at n=1000n = 1000. Rarer bursts push the requirement further. With burst probability 0.0001, a sample of n=1000n = 1000 contains no burst at all with probability 0.99991000≈0.9050.9999^{1000} \approx 0.905.

Stated precisely

Lindeberg–Lévy central limit theorem. Let X1,X2,…X_1, X_2, \dots be independent random variables, numerical outcomes of a random experiment, with one common distribution, mean μ\mu and variance σ2\sigma^2, where 0<σ2<∞0 < \sigma^2 < \infty. Let X‾n\bar X_n be the mean of the first nn, let Zn=n(X‾n−μ)/σZ_n = \sqrt n\,(\bar X_n - \mu)/\sigma, and let Φ(z)\Phi(z) be the probability that a standard normal random variable is at most zz. Then for every real number zz, limn→∞Pr(Zn≤z)=Φ(z).\lim_{n \to \infty} \Pr(Z_n \le z) = \Phi(z). This kind of convergence, of the probabilities Pr(Zn≤z)\Pr(Z_n \le z), is called convergence in distribution.

The Berry–Esseen theorem bounds the error at a finite nn when, in addition, ρ=E[|X1−μ|3]\rho = E[|X_1 - \mu|^3] is finite: for every zz, |Pr(Zn≤z)−Φ(z)|≤Cρσ3n,|\Pr(Z_n \le z) - \Phi(z)| \le \frac{C\rho}{\sigma^3 \sqrt n}, where CC is a constant, the same for all distributions, proved to be less than 0.48. The bound shrinks like 1/n1/\sqrt n, but it grows with ρ/σ3\rho/\sigma^3, which measures how lopsided and heavy-tailed the distribution is. For the burst example, ρ=0.99×13+0.01×993≈9704\rho = 0.99 \times 1^3 + 0.01 \times 99^3 \approx 9704 and σ3=993/2≈985\sigma^3 = 99^{3/2} \approx 985, so ρ/σ3≈9.85\rho/\sigma^3 \approx 9.85. At n=30n = 30 the guaranteed error is only below 0.48×9.85/30≈0.860.48 \times 9.85/\sqrt{30} \approx 0.86, which guarantees nothing useful.

No sample size works for every distribution with finite variance. For any fixed nn, choose the burst probability pp so small that a sample contains no burst with probability (1−p)n(1 - p)^n close to 1. The sample mean is then almost always 0, far from a normal shape, although the variance is finite.

Limits and common mistakes

The CLT is about the average, not the data. The individual observations stay exactly as skewed as they were; a large sample shows their skew more clearly, not less.

Infinite variance breaks the basic theorem. For the Cauchy distribution, a bell-shaped distribution with tails so heavy that it has no mean, the average of nn independent observations has exactly the same distribution as one observation, for every nn. Other distributions whose variance is infinite need a different scaling, and their averages in general approach limits that are not normal.

Suppose each of the nn observations has variance σ2\sigma^2. The variance of their mean is σ2n+2n2∑i<jCov(Xi,Xj).\frac{\sigma^2}{n}+\frac{2}{n^2}\sum_{i<j}\mathrm{Cov}(X_i,X_j). Covariance §15.44 measures whether two observations tend to move together or in opposite directions. Suppose the first reading is equally likely to be 1 or -1. If the second repeats it, their mean still has variance 1. If the second is its opposite, their mean is always 0. Treating the readings as independent would give variance 1/21/2 in both examples. Repeated trials on one board can estimate variation within that board. Counting them as independently sampled boards is pseudoreplication §11.6: they give no direct evidence of variation across boards. When conditions change, the expected sample mean averages the means of the sampled conditions. Those means may agree even when the distributions differ.

The CLT leaves bias untouched. It centers the average on the mean of what is measured, so an instrument that adds a constant offset produces a bell centered on the wrong value. The law of large numbers §15.46 entry treats this.

The Berry–Esseen error is an absolute error, so it can exceed a small tail probability itself. An absolute error bound of 0.01 is about 3.3 percent of a probability of 0.3, but ten times a probability of 0.001. The latter bound cannot establish even the order of magnitude of the tail probability.

The theorem concerns means and sums. The median §11.13 and high percentiles §11.16 have their own large-sample rules. The rule of thumb ‘30 observations are enough’ is not a theorem. Methods such as the bootstrap, which resamples the observed data, avoid assuming a normal shape, but they also need samples that represent the tail.

Questions answered

Why is there no universal sample size that makes every skewed measurement normal enough?

There is no universal sample size because how fast the average approaches the normal bell curve depends on the shape of the distribution being averaged and on the accuracy needed, and the shape can be made as unfavorable as one likes. The central limit theorem (CLT) only states a limit as the sample size grows. The Berry–Esseen theorem bounds the error at a given sample size nn by a constant times ρ/(σ3n)\rho/(\sigma^3\sqrt n), where σ\sigma is the standard deviation and ρ\rho the average cubed distance from the mean; the ratio ρ/σ3\rho/\sigma^3 is large for lopsided, heavy-tailed data and has no upper limit.

A rare burst shows it. An observation that is 0 with probability 0.99 and 100 with probability 0.01 has finite variance, yet a sample of 30 contains no burst with probability 0.9930≈0.740.99^{30} \approx 0.74, so its mean is exactly 0 in 74% of samples, nothing like a bell curve. For any fixed nn, a small enough burst probability makes almost every sample burst-free. Dependence between observations and changing conditions make matters worse. So check whether the observations are really independent, look at the tail, and choose an uncertainty method that fits the process instead of a fixed count.

Related entries: Independent and identically distributed samples (§11.5), Pseudoreplication (§11.6), Standard error (§11.15), Confidence interval (§11.18), Law of large numbers (§15.46), Bootstrap (§11.19), Latency distribution and tail (§11.36).