Probability runs forwards: given the coin, what will the flips look like? Statistics runs backwards: given the flips, what is the coin? You never see the true parameters of a market, only data. Two theorems connect the two directions, and almost every number a quant reports leans on them.
The statistician’s set-up
- Treat each observation as a random variable, and assume a family for it (Bernoulli, Poisson, normal…). Usually also assume the observations are i.i.d.: independent and identically distributed.
- Link the unknown parameter to the data with an estimator. If each is Bernoulli then , so estimate with the sample average: .
- Say how confident you are. If , is the truth in ? ? The next lesson answers that.
Law of large numbers
Averages converge to the true mean. That is what makes the estimator in step 2 sensible: for every common distribution the mean is a simple function of the parameter, so a long enough average pins the parameter down.
Central limit theorem
The LLN says the average gets close. The CLT says how close, and what the error looks like:
Whatever the distribution of a single draw (as long as its variance is finite), the error of the average is approximately normal with standard deviation . This is why the bell curve is everywhere: many measured quantities are sums of lots of small independent effects.
In code
import numpy as np
rng = np.random.default_rng(4)
# Averages of n exponential draws, standardised: approaches N(0, 1)
n, reps = 30, 200_000
x = rng.exponential(1.0, size=(reps, n))
z = (x.mean(axis=1) - 1.0) / (1.0 / np.sqrt(n))
print(z.mean(), z.std()) # ≈ 0, ≈ 1
print(np.mean(np.abs(z) < 1.96)) # ≈ 0.95
# How long until a Sharpe-1 strategy shows t = 2?
sharpe = 1.0
years = (2 / sharpe) ** 2
print(years) # 4.0
Check yourself
You estimate a mean from 100 i.i.d. observations and the standard error is 0.4. Roughly how many observations do you need for a standard error of 0.1?