SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 5.7.1 The Markov, Chebyshev and Jensen inequalitiesConcept · 35 min
      2. 5.7.2 The law of large numbersConcept · 30 min
      3. 5.7.3 The central limit theoremConcept · 35 min
      4. 5.7.4 Practice set: inequalities and limit theoremsPractice set · 25 min
      5. 5.7.5 Case study: the error of a Monte Carlo priceCase study · 35 min

Level 5, Probability and statistics 5.7 Inequalities and limit theorems Lesson 3 of 5

ConceptLesson 5.7.3 in Level 5, Probability and statistics. About 35 minutes.

The central limit theorem

The shape of a sum

Lesson 5.7.2 gave the centre and the spread of the sample mean Xˉn\bar{X}_n of nn i.i.d. draws: mean μ\mu, standard error σn\frac{\sigma}{\sqrt{n}}. The central limit theorem gives its shape. For large nn it is close to a normal, whatever the distribution of one draw.

To see the shape, remove the centre and the spread. Standardising (lesson 5.3.2) gives a variable with mean 0 and variance 1 for every nn. With Sn=X1+⋯+XnS_n = X_1 + \cdots + X_n the sum,

Zn=Xˉn−μσ/n=Sn−nμσn\begin{aligned} Z_n &= \frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} \\ &= \frac{S_n - n\mu}{\sigma\sqrt{n}} \end{aligned}

Rule: Central limit theorem

P(Zn≤z)→N(z) as n→∞Xˉn≈N ⁣(μ,σ2n)Sn≈N(nμ, nσ2)\begin{gathered} P(Z_n \le z) \to N(z) \text{ as } n \to \infty \\[4pt] \bar{X}_n \approx \mathcal{N}\!\left(\mu, \tfrac{\sigma^2}{n}\right) \\[4pt] S_n \approx \mathcal{N}(n\mu,\ n\sigma^2) \end{gathered}

For i.i.d. draws with mean μ\mu and a finite variance σ2>0\sigma^2 > 0. NN is the standard normal distribution function. For large nn, the mean and the sum are approximately normal, with the mean and variance of lesson 5.7.2.

Without the standardising there is nothing to see: Xˉn\bar{X}_n collapses onto μ\mu (lesson 5.7.2), and SnS_n spreads out without limit. The theorem describes the shape at the scale σn\frac{\sigma}{\sqrt{n}}.

For normal draws ZnZ_n is exactly standard normal at every nn (lesson 5.6.3). The theorem says that other distributions get there too, as nn grows.

Dice: from a triangle to a bell

Lesson 5.6.3 built the pmf of the sum of two dice by convolution: a triangle. Convolve in more dice and the triangle rounds into a bell.

Take 10 dice. The sum has mean 10×3.5=3510 \times 3.5 = 35 and standard deviation 10×35/12≈5.4006\sqrt{10 \times 35/12} \approx 5.4006. By the exact pmf, P(S10≤30)≈0.2050P(S_{10} \le 30) \approx 0.2050; the normal gives N ⁣(30−355.4006)≈0.1773N\!\left(\frac{30 - 35}{5.4006}\right) \approx 0.1773.

Whole numbers: the half-step

The sum of dice takes whole values, and the normal spreads the probability of each value ss over the interval from s−12s - \frac{1}{2} to s+12s + \frac{1}{2}. So "S≤30S \le 30" is best read as "S≤30.5S \le 30.5". This continuity correction gives N ⁣(30.5−355.4006)≈0.2024N\!\left(\frac{30.5 - 35}{5.4006}\right) \approx 0.2024, much closer to 0.2050.

With 100 dice the mean is 350 and the standard deviation about 17.0783. Exactly, P(S100≥380)≈0.0420P(S_{100} \ge 380) \approx 0.0420. The normal gives 0.0395 from 380 and 0.0421 from the half-step at 379.5.

A coin works the same way. The number of heads in 100 tosses has mean 50 and standard deviation 5. Exactly, P(heads≤45)≈0.1841P(\text{heads} \le 45) \approx 0.1841; the normal gives 0.1587 from 45 and 0.1841 from 45.5.

Try it

The loop convolves in one die at a time, 100 times (lesson 5.6.3), and stops to check 10 dice on the way. Each line prints the standard deviation, the exact probability, the normal, and the normal with the half-step.

The last line is the coin, with binom.cdf for the exact answer.

⌘/Ctrl + Enter runs the cell

Three starting distributions

The theorem does not care where the draws come from. Three very different starts:

  • Uniform on [0,1][0, 1]: flat and symmetric, with μ=12\mu = \frac{1}{2} and σ2=112\sigma^2 = \frac{1}{12}.
  • Exponential with mean 1 (lesson 5.4.2): skewed, with a long right tail, μ=1\mu = 1 and σ=1\sigma = 1.
  • A fair coin, 0 or 1: only two values, μ=12\mu = \frac{1}{2} and σ=12\sigma = \frac{1}{2}.

The standardised mean of 10 draws from each start. The uniform's is already almost normal, and the coin's follows the curve in steps. The exponential's is still skewed, so its upper tail holds more than the normal's 0.025.

A simulation shows all three at once. For each start and each nn, draw 20,000 samples of size nn and standardise their means.

Then count the share within ±1.96\pm 1.96, 95% for a normal, and the share above 1.96, 2.5% for a normal. In one seeded run:

startn=1n = 1n=5n = 5n=30n = 30
uniform, share within ±1.96\pm 1.9610.95140.9508
exponential, within ±1.96\pm 1.960.94660.9570.9526
exponential, above 1.960.05340.04270.0338
coin, within ±1.96\pm 1.9610.93860.9556

A single uniform draw never strays 1.96 standard deviations, and a single coin is always exactly one away. By n=5n = 5 the uniform is already close to 95%. The exponential's total is near 95% even at n=1n = 1, but lopsided: too much above 1.96, too little below −1.96-1.96.

Try it

Each start is a function that draws an array of a given shape. Each row of draw((20_000, n)) is one sample, and .mean(axis=1) averages each row.

The columns are the start, nn, the share within ±1.96\pm 1.96, the share above 1.96, and the skewness of the 20,000 means (lesson 5.3.3).

⌘/Ctrl + Enter runs the cell

How fast: the skewness fades like 1n\frac{1}{\sqrt{n}}

The skewness of a mean of nn draws is the skewness of one draw divided by n\sqrt{n} (stated here). The uniform and the coin have skewness 0, so only their flatness or gaps must fade.

The exponential starts at 2, and its mean is still visibly skewed long after. The simulation above found 2.01, 0.87 and 0.34 at nn = 1, 5 and 30, against 2n\frac{2}{\sqrt{n}} = 2, 0.8944 and 0.3651.

The exponential's sum is a gamma distribution (lesson 5.6.3 met the case n=2n = 2), so its tails are known exactly:

nn151030100
P(Zn>1.96)P(Z_n > 1.96)0.05180.04330.03930.0340.0302
P(Zn<−1.96)P(Z_n < -1.96)00.00040.00580.0140.0192
skewness 2n\frac{2}{\sqrt{n}}20.89440.63250.36510.2

Even at n=100n = 100 the upper tail holds 3.02%, not 2.5%. The more skewed the draws, the larger nn must be.

Try it

gamma.sf(x, n) is the probability that a gamma sum with shape nn exceeds xx. Zn>1.96Z_n > 1.96 means Sn>n+1.96nS_n > n + 1.96\sqrt{n}, since μ=σ=1\mu = \sigma = 1.

Each line prints nn, the two tails and the skewness 2n\frac{2}{\sqrt{n}}.

⌘/Ctrl + Enter runs the cell

Set the explorer to n=1n = 1: the histogram is the exponential itself. Step through n=2n = 2, 5, 30 and 100. The histogram narrows like 1n\frac{1}{\sqrt{n}} and its skew fades.

The share within 1.96σn1.96\frac{\sigma}{\sqrt{n}} in the readout stays near 95% throughout; the histogram shows how lopsided it is for small nn.

Explore

Each bar counts how many of 2,000 samples had their mean in that range. Raise the sample size n: the histogram narrows like 1/√n and takes the shape of the normal curve, even from a skewed start.

01200.51
True mean and standard deviation
μ = 1, σ = 1
The 2000 sample means
average 1.0092, standard deviation 0.4566 against σ/√n = 0.4472
Within 1.96 σ/√n of μ
95.3% of the means (the normal curve says 95%)

The 1n\frac{1}{\sqrt{n}} scale of the error

By the theorem, about 95% of sample means land within 1.96σn1.96\frac{\sigma}{\sqrt{n}} of μ\mu: the 1.96 is the normal's quantile from lesson 5.4.3. That band has half-width proportional to 1n\frac{1}{\sqrt{n}}.

Rule: Error scale of a mean

P(∣Xˉn−μ∣≤1.96 σn)≈0.95n≈(1.96 σε)2\begin{gathered} P\left(|\bar{X}_n - \mu| \le 1.96\,\frac{\sigma}{\sqrt{n}}\right) \approx 0.95 \\[4pt] n \approx \left(\frac{1.96\,\sigma}{\varepsilon}\right)^2 \end{gathered}

The second line is the number of draws for a 95% half-width ε\varepsilon. Ten times the draws narrow the band 10≈3.16\sqrt{10} \approx 3.16 times. One more correct digit, a band ten times narrower, needs a hundred times the draws.

For a die the 95% half-width is 0.3347 after 100 rolls, 0.1059 after 1,000 and 0.0335 after 10,000. To get within 0.1 with 95% probability takes (1.96σ/0.1)2(1.96\sigma/0.1)^2, about 1,121 rolls. Chebyshev's inequality, which must cover every distribution, asked for 5,834 (lesson 5.7.2).

Case study 3.7.4's band

Case study 3.7.4 estimated a correlation 400 times at each sample size. The middle 90% of the estimates ran from 0.363 to 0.604 with 100 draws, 0.462 to 0.537 with 1,000, and 0.487 to 0.513 with 10,000.

The widths are 0.241, 0.075 and 0.026. Each tenfold step narrowed the band 3.21 and then 2.88 times: about 10≈3.16\sqrt{10} \approx 3.16, as the rule says.

An estimated correlation is not a plain mean, but it is built from means of products and squares of the draws. For large samples its error behaves like a mean's error: close to normal, with a spread proportional to 1n\frac{1}{\sqrt{n}}.

Case study 4.7.5's standard errors

Case study 4.7.5 found each simulated probability within two standard errors p^(1−p^)/N\sqrt{\hat{p}(1 - \hat{p})/N} of the truth. The theorem says how often that happens.

The share p^\hat{p} is a mean of indicators (lesson 5.7.2), so it is close to normal. A miss within 1.96 standard errors then has probability about 0.95.

Repeat case study 4.7.5's simulation with N=10,000N = 10{,}000 draws 100,000 times, with a seed. The miss was within 1.96 estimated standard errors 94.67% of the time, and within 2 of them 95.39%. A simulated number with its standard error is a statement of this kind.

Try it

The first lines are the die's 95% half-widths, 10\sqrt{10}, and the rolls needed for a half-width of 0.1.

Then case study 3.7.4's band widths and their ratios. The last lines repeat case study 4.7.5's estimate 100,000 times. rng.binomial counts the corner years among NN draws directly, and the line checks how often the miss is within 1.96 and 2 standard errors.

⌘/Ctrl + Enter runs the cell

Where the theorem fails

Far in the tails. The theorem is about the middle of the distribution. Even where the middle is close, a tail probability can be off many times over.

For the exponential at n=30n = 30, P(Zn>4)≈0.000386P(Z_n > 4) \approx 0.000386, against the normal's 0.000032: 12.2 times as large. At n=100n = 100 it is still 5.1 times.

No finite variance. A Student t with ν=1\nu = 1 has neither a variance nor a mean (lesson 5.4.4). The mean of nn such draws has the same distribution as one draw (stated here), so averaging narrows nothing.

In a seeded simulation the middle 90% of such means had widths 13.6, 13.86, 14.42 and 11.79 for nn = 1, 10, 100 and 1,000. One draw's exact width is 12.63.

Dependence. The theorem needs independent draws, or nearly so. Copies of one draw, or strongly correlated draws, do not average out at the rate σn\frac{\sigma}{\sqrt{n}}.

Try it

The loop prints the exponential's exact P(Zn>4)P(Z_n > 4), the normal's, and their ratio.

Then t draws with ν=1\nu = 1: for each nn, the width of the middle 90% of 2,000 seeded sample means. The last line is the exact width for one draw, from t.ppf.

⌘/Ctrl + Enter runs the cell

Case study 5.7.5 uses the theorem to put a 95% interval around a simulated option price.

Common mistakes

  1. The theorem is about sums and means, not about the draws. A thousand exponential draws are still skewed; their mean is close to normal.
  2. Standardise with the standard error σn\frac{\sigma}{\sqrt{n}}, not with σ\sigma of one draw.
  3. n=30n = 30 is not a magic number. For the exponential at n=30n = 30 the upper tail beyond 1.96 holds 0.034, not 0.025.
  4. Whole-number counts need the half-step. For heads in 100 tosses, P(heads≤45)P(\text{heads} \le 45) uses 45.5: 0.1841, not 0.1587.
  5. Ten times the draws narrow a band 10≈3.16\sqrt{10} \approx 3.16 times, not 10.
  6. No finite variance, no theorem. Means of t draws with ν=1\nu = 1 never narrow.
  7. Do not trust the normal far in the tails. The middle can be close while a 4-sigma probability is off by a factor of 12.

The central limit theorem

0 of 11 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • Central limit theorem: for i.i.d. draws with finite variance, Zn=Xˉn−μσ/nZ_n = \frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} has P(Zn≤z)→N(z)P(Z_n \le z) \to N(z). So Xˉn≈N(μ,σ2n)\bar{X}_n \approx \mathcal{N}(\mu, \frac{\sigma^2}{n}) and Sn≈N(nμ,nσ2)S_n \approx \mathcal{N}(n\mu, n\sigma^2), whatever the start.
  • Whole-number sums: use the half-step, P(S≤s)≈N(s+0.5−nμσn)P(S \le s) \approx N\left(\frac{s + 0.5 - n\mu}{\sigma\sqrt{n}}\right).
  • About 95% of means lie within 1.96σn1.96\frac{\sigma}{\sqrt{n}} of μ\mu; a half-width ε\varepsilon needs n≈(1.96σ/ε)2n \approx (1.96\sigma/\varepsilon)^2. Ten times the draws narrow the band 10\sqrt{10} times; one more digit costs 100 times the draws.
  • Skewness fades like 1n\frac{1}{\sqrt{n}}, so skewed draws need larger nn; far tails can stay wrong many times over.
  • No finite variance (t with ν=1\nu = 1) or strong dependence: no theorem.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.