Let (Xn) be a sequence of iid Gaussian random variables, Xn∼N(μ,σ2), and let
Xn≜n1i=1∑nXi.
Then Xn has parameters
E(Xn)=μ,var(Xn)=nσ2.
The law of large numbers (LLN, from the earlier lectures on limit laws) guarantees
n→∞limP(∣Xn−μ∣≥ε)=0,
which is exactly the definition of XnPn→∞μ, and therefore also XnDn→∞μ (convergence in probability implies convergence in distribution).
Is this the end of the story? Not at all, at least in this special case where the distribution function (DF) of Xn is completely known. Indeed Xn∼N(μ,nσ2), so standardizing Xn,
σn(Xn−μ)∼N(0,1)for all n,
or (trivially)
σn(Xn−μ)Dn→∞N(0,1).
One way of interpreting this result: σn is the scale factor by which to amplify the "error" Xn−μ to obtain a non-trivial DF. Indeed
Xn−μD1(x)
(the DF of the constant 0, i.e. the unit step), which is a degenerate limit, but after amplifying the "error",
σn(Xn−μ)DN(0,1),
which here is actually true for all n.
The theorem proved below shows that also in the general case, without Gaussianity assumptions on the (Xn), the standardized Xn is asymptotically distributed as N(0,1). This extremely powerful limit law is the central limit theorem.
Statement (Lindeberg-Levy)
The CLT has several versions; here a basic one, sufficient for our purposes.
Theorem (CLT, Lindeberg-Levy). Let (Xn) be an iid sequence of random variables admitting first moment E(X1)=μ and variance var(X1)=σ2. Then the standardized arithmetic mean Wn satisfies
Wn≜σn(Xn−μ)Dn→∞N(0,1).
Remark.Xn has mean E(Xn)=μ and variance var(Xn)=nσ2, therefore the standardized Xn is
σ/nXn−μ=σn(Xn−μ),
which coincides with Wn. Clearly E(Wn)=0 and var(Wn)=1 for all n, but only asymptotically is the distribution N(0,1), no matter what the distribution of the (Xn) is.
Proof
Rewrite Wn as a sum of standardized Xi's:
Wn=σn(Xn−μ)=σn(n1i=1∑nXi−μ)=σn(n1i=1∑n(Xi−μ))=n1i=1∑nσXi−μ=n1i=1∑nYi,
where we define
Yi≜σXi−μ.
The (Yn) are iid with E(Y1)=0 and var(Y1)=1.
Let φY1(ω) be the characteristic function (CF) of Y1. Its Mc-Laurin expansion is
φY1(ω)=φY1(0)+dωdφY1ω=0ω+dω2d2φY1ω=02ω2+o(ω2),
where:
φY1(0)=1;
dωdφY1ω=0=jμY1=0;
dω2d2φY1ω=0=j2σY12=−1, since σY12=E(Y12) (the mean is 0).
Therefore
φY1(ω)=1−2ω2+o(ω2).
From φY1, using the properties of CFs (independence turns the CF of a sum into a product, and scaling the variable by c rescales the argument),
φ∑1nYi(ω)=(φY1(ω))n,φWn(ω)=φn1∑Yi(ω)=φ∑Yi(nω)=(1−nω2/2+o(nω2))n,
and finally
n→∞limφWn(ω)=n→∞lim(1−nω2/2+o(nω2))n=e−ω2/2.
Recalling that e−21ω2 is the CF of N(0,1), and the continuity theorem of Levy (convergence φWn(ω)→φ(ω) of the CFs implies WnDN(0,1)), the proof is complete. □
Gaussian approximation
We have proved that
Wn=σn(Xn−μ)DN(0,1).
In practice this means that for n large enough
σn(Xn−μ)≈N(0,1),
i.e. one can compute probabilities relative to σn(Xn−μ) using the DF N(0,1)no matter what the DF of the (Xn) is.
Equivalent forms of the Gaussian approximation (also known as normal approximation) are
i=1∑nXi≈N(nμ,nσ2),Xn=n1i=1∑nXi≈N(μ,nσ2).
In practice, as long as there is a sum of iid random variables, or a scaled or a standardized sum, it is always approximable with a Gaussian of the correct mean and variance.
Examples
Notation: Φ is the DF of N(0,1), Z∼N(0,1).
Example 1 (battery box)
Battery life is about 3 hours on average. What is the probability that a box of 30 batteries lasts at least 78 hours?
Let Xn be the battery life, well modeled by an exponential random variable Xn∼Exp(31), so that E(X1)=3 and var(X1)=9. Let
S30=t=1∑30Xt
be the life of the box of batteries. Then
E(S30)=30⋅3=90,var(S30)=30⋅9=270.
By normal approximation S30≈N(90,270) and
P(S30≥78)=P(270S30−90≥27078−90)=P(Z≥−0.73)=1−Φ(−0.73)=Φ(0.73)≅0.77.
Example 2 (how many batteries)
Continuing Example 1: how many batteries must be bought so that they last at least 78 hours with probability at least 0.95?
Now Sn=∑t=1nXt, with n to be determined imposing
P(Sn≥78)≥0.95.
Again using the normal approximation, with E(Sn)=3n and var(Sn)=9n:
P(Sn≥78)=P(3nSn−3n≥3n78−3n)≥0.95,
where 3nSn−3n≈Z∼N(0,1). That is
1−Φ(3n78−3n)≥0.95⟺Φ(3n78−3n)≤0.05⟺Φ(3n3n−78)≥0.95,
i.e.
3n3n−78≥1.65⟹n≥36.
Example 3 (sample size for a proportion)
(Xn) iid Bernoulli b(p), Xn=nn1 (relative frequency of ones), with
E(Xn)=p,var(Xn)=np(1−p).
Solve the same problem as before: how many observations n are needed to guarantee
P(nn1−p≤0.05)≥0.95?
By the normal approximation (the standardized quantity is ≈N(0,1)):
P(nn1−p≤0.05)=P(p(1−p)/nnn1−p≤p(1−p)/n0.05)=2Φ(p(1−p)0.05n)−1≥0.95,
or
Φ(p(1−p)0.05n)≥0.975 implies p(1−p)0.05n≥1.96 or n≥0.05p(1−p)⋅1.96.
The worst case is p=21, corresponding to n=19.6, or n≈400, to be compared with n≈2000 from Chebyshev's inequality.
Rule of thumb
Let (Xn) be iid with E(X1)=μ, var(X1)=σ2. Then
P(σn∑i=1nXi−nμ≤1.96)≃0.95,
i.e.
P(i=1∑nXi∈[nμ−1.96σn,nμ+1.96σn])≃0.95.
With Bernoulli random variables (rounding 1.96 to 2):
P(n1∈[np−2p(1−p)n,np+2p(1−p)n])≃0.95.
Question: is the coin fair? If the coin is fair, then with probability ≃0.95n1∈[2n−n,2n+n].
Note that:
if n=1000, n1∈[469,531], half-width 3%;
if n=106, n1∈[499000,501000], half-width 1 per thousand.
The CLT is inescapable.
Versione ripasso
Setting.(Xn) iid, E(X1)=μ, var(X1)=σ2<∞, Xn=n1∑1nXi with E(Xn)=μ, var(Xn)=σ2/n.
LLN vs CLT. LLN: XnPμ (degenerate limit, Xn−μD unit step). CLT: amplify the error by n/σ to get a non-trivial limit.
Theorem (Lindeberg-Levy).Wn=σn(Xn−μ)=σ/nXn−μDN(0,1),
with E(Wn)=0, var(Wn)=1 for all n, whatever the distribution of the Xn. If the Xn are Gaussian, Wn∼N(0,1) exactly for every n.
Proof idea.Wn=n1∑Yi, Yi=σXi−μ iid, mean 0, variance 1. Then φY1(ω)=1−2ω2+o(ω2) (derivatives at 0: jμY=0, j2σY2=−1), φWn(ω)=(1−nω2/2+o(nω2))n→e−ω2/2, the CF of N(0,1); conclude with Levy's continuity theorem.
Gaussian approximation (large n).i=1∑nXi≈N(nμ,nσ2),Xn≈N(μ,nσ2).
Works for any sum of iid variables (also scaled or standardized).
Recipe. Compute mean and variance of the sum, standardize, use Φ.
Batteries: S30≈N(90,270), P(S30≥78)=Φ(0.73)≅0.77; for P(Sn≥78)≥0.95: 3n3n−78≥1.65⇒n≥36.
Bernoulli: P(∣nn1−p∣≤0.05)≥0.95⟺n≥1.960.05p(1−p); worst case p=21: n≈400 (Chebyshev: about 2000).
Rule of thumb.P(∑Xi∈[nμ±1.96σn])≃0.95. Fair coin: n1∈[2n−n,2n+n] w.p. ≃0.95 (n=1000: [469,531]).
Typical mistakes. Forgetting to standardize with σn (not σ/n) for sums; using var(Sn)=nσ instead of nσ2; reading P(Z≥−a) as 1−Φ(a) (it is Φ(a)); applying the approximation without independence or finite variance.