Salta al contenuto
Note per Studenti Central Limit Theorem Report

Central Limit Theorem

In questa pagina 6

Motivation: the Gaussian case

Let (Xn)(X_n) be a sequence of iid Gaussian random variables, Xn∼N(μ,σ2)X_n \sim N(\mu,\sigma^2), and let X‾n≜1n∑i=1nXi.\overline{X}_n \triangleq \frac1n\sum_{i=1}^n X_i . Then X‾n\overline{X}_n has parameters E(X‾n)=μ,var⁡(X‾n)=σ2n.E(\overline{X}_n)=\mu, \qquad \operatorname{var}(\overline{X}_n)=\frac{\sigma^2}{n}.

The law of large numbers (LLN, from the earlier lectures on limit laws) guarantees lim⁡n→∞P(∣X‾n−μ∣≥ε)=0,\lim_{n\to\infty} P\big(|\overline{X}_n-\mu|\ge \varepsilon\big)=0 , which is exactly the definition of X‾n→n→∞Pμ\overline{X}_n \xrightarrow[n\to\infty]{P} \mu, and therefore also X‾n→n→∞Dμ\overline{X}_n \xrightarrow[n\to\infty]{D} \mu (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 X‾n\overline{X}_n is completely known. Indeed X‾n∼N ⁣(μ,σ2n)\overline{X}_n\sim N\!\left(\mu,\frac{\sigma^2}{n}\right), so standardizing X‾n\overline{X}_n, nσ (X‾n−μ)∼N(0,1)for all n,\frac{\sqrt n}{\sigma}\,(\overline{X}_n-\mu)\sim N(0,1)\quad\text{for all } n, or (trivially) nσ (X‾n−μ)→n→∞DN(0,1).\frac{\sqrt n}{\sigma}\,(\overline{X}_n-\mu)\xrightarrow[n\to\infty]{D} N(0,1).

One way of interpreting this result: nσ\frac{\sqrt n}{\sigma} is the scale factor by which to amplify the "error" X‾n−μ\overline{X}_n-\mu to obtain a non-trivial DF. Indeed X‾n−μ→D1(x)\overline{X}_n-\mu \xrightarrow{D} \mathbb{1}(x) (the DF of the constant 00, i.e. the unit step), which is a degenerate limit, but after amplifying the "error", nσ(X‾n−μ)→DN(0,1),\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu)\xrightarrow{D} N(0,1), which here is actually true for all nn.

The theorem proved below shows that also in the general case, without Gaussianity assumptions on the (Xn)(X_n), the standardized X‾n\overline{X}_n is asymptotically distributed as N(0,1)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)(X_n) be an iid sequence of random variables admitting first moment E(X1)=μE(X_1)=\mu and variance var⁡(X1)=σ2\operatorname{var}(X_1)=\sigma^2. Then the standardized arithmetic mean WnW_n satisfies Wn≜nσ (X‾n−μ)→n→∞DN(0,1).W_n \triangleq \frac{\sqrt n}{\sigma}\,(\overline{X}_n-\mu)\xrightarrow[n\to\infty]{D} N(0,1).

Remark. X‾n\overline{X}_n has mean E(X‾n)=μE(\overline{X}_n)=\mu and variance var⁡(X‾n)=σ2n\operatorname{var}(\overline{X}_n)=\frac{\sigma^2}{n}, therefore the standardized X‾n\overline{X}_n is X‾n−μσ/n=nσ(X‾n−μ),\frac{\overline{X}_n-\mu}{\sigma/\sqrt n}=\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu), which coincides with WnW_n. Clearly E(Wn)=0E(W_n)=0 and var⁡(Wn)=1\operatorname{var}(W_n)=1 for all nn, but only asymptotically is the distribution N(0,1)N(0,1), no matter what the distribution of the (Xn)(X_n) is.

Proof

Rewrite WnW_n as a sum of standardized XiX_i's: Wn=nσ(X‾n−μ)=nσ(1n∑i=1nXi−μ)=nσ(1n∑i=1n(Xi−μ))=1n∑i=1nXi−μσ=1n∑i=1nYi,W_n=\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu)=\frac{\sqrt n}{\sigma}\left(\frac1n\sum_{i=1}^n X_i-\mu\right)=\frac{\sqrt n}{\sigma}\left(\frac1n\sum_{i=1}^n (X_i-\mu)\right)=\frac1{\sqrt n}\sum_{i=1}^n\frac{X_i-\mu}{\sigma}=\frac1{\sqrt n}\sum_{i=1}^n Y_i , where we define Yi≜Xi−μσ.Y_i \triangleq \frac{X_i-\mu}{\sigma}. The (Yn)(Y_n) are iid with E(Y1)=0E(Y_1)=0 and var⁡(Y1)=1\operatorname{var}(Y_1)=1.

Let φY1(ω)\varphi_{Y_1}(\omega) be the characteristic function (CF) of Y1Y_1. Its Mc-Laurin expansion is φY1(ω)=φY1(0)+dφY1dω∣ω=0ω+d2φY1dω2∣ω=0ω22+o(ω2),\varphi_{Y_1}(\omega)=\varphi_{Y_1}(0)+\frac{d\varphi_{Y_1}}{d\omega}\Big|_{\omega=0}\omega+\frac{d^2\varphi_{Y_1}}{d\omega^2}\Big|_{\omega=0}\frac{\omega^2}{2}+o(\omega^2), where:

  • φY1(0)=1\varphi_{Y_1}(0)=1;
  • dφY1dω∣ω=0=jμY1=0\frac{d\varphi_{Y_1}}{d\omega}\big|_{\omega=0}=j\mu_{Y_1}=0;
  • d2φY1dω2∣ω=0=j2σY12=−1\frac{d^2\varphi_{Y_1}}{d\omega^2}\big|_{\omega=0}=j^2\sigma_{Y_1}^2=-1, since σY12=E(Y12)\sigma_{Y_1}^2=E(Y_1^2) (the mean is 00).

Therefore φY1(ω)=1−ω22+o(ω2).\varphi_{Y_1}(\omega)=1-\frac{\omega^2}{2}+o(\omega^2).

From φY1\varphi_{Y_1}, using the properties of CFs (independence turns the CF of a sum into a product, and scaling the variable by cc rescales the argument), φ∑1nYi(ω)=(φY1(ω))n,\varphi_{\sum_1^n Y_i}(\omega)=\big(\varphi_{Y_1}(\omega)\big)^n, φWn(ω)=φ1n∑Yi(ω)=φ∑Yi ⁣(ωn)=(1−ω2/2n+o ⁣(ω2n))n,\varphi_{W_n}(\omega)=\varphi_{\frac1{\sqrt n}\sum Y_i}(\omega)=\varphi_{\sum Y_i}\!\left(\frac{\omega}{\sqrt n}\right)=\left(1-\frac{\omega^2/2}{n}+o\!\left(\frac{\omega^2}{n}\right)\right)^{n}, and finally lim⁡n→∞φWn(ω)=lim⁡n→∞(1−ω2/2n+o ⁣(ω2n))n=e−ω2/2.\lim_{n\to\infty}\varphi_{W_n}(\omega)=\lim_{n\to\infty}\left(1-\frac{\omega^2/2}{n}+o\!\left(\frac{\omega^2}{n}\right)\right)^{n}=e^{-\omega^2/2}.

Recalling that e−12ω2e^{-\frac12\omega^2} is the CF of N(0,1)N(0,1), and the continuity theorem of Levy (convergence φWn(ω)→φ(ω)\varphi_{W_n}(\omega)\to\varphi(\omega) of the CFs implies Wn→DN(0,1)W_n\xrightarrow{D}N(0,1)), the proof is complete. □\square

Gaussian approximation

We have proved that Wn=nσ(X‾n−μ)→DN(0,1).W_n=\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu)\xrightarrow{D}N(0,1). In practice this means that for nn large enough nσ(X‾n−μ)≈N(0,1),\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu)\approx N(0,1), i.e. one can compute probabilities relative to nσ(X‾n−μ)\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu) using the DF N(0,1)N(0,1) no matter what the DF of the (Xn)(X_n) is.

Equivalent forms of the Gaussian approximation (also known as normal approximation) are ∑i=1nXi≈N(nμ, nσ2),X‾n=1n∑i=1nXi≈N ⁣(μ,σ2n).\sum_{i=1}^n X_i\approx N(n\mu,\,n\sigma^2),\qquad \overline{X}_n=\frac1n\sum_{i=1}^n X_i\approx N\!\left(\mu,\frac{\sigma^2}{n}\right).

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: Φ\Phi is the DF of N(0,1)N(0,1), Z∼N(0,1)Z\sim 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 XnX_n be the battery life, well modeled by an exponential random variable Xn∼Exp ⁣(13)X_n\sim\mathrm{Exp}\!\left(\frac13\right), so that E(X1)=3E(X_1)=3 and var⁡(X1)=9\operatorname{var}(X_1)=9. Let S30=∑t=130XtS_{30}=\sum_{t=1}^{30}X_t be the life of the box of batteries. Then E(S30)=30⋅3=90,var⁡(S30)=30⋅9=270.E(S_{30})=30\cdot 3=90,\qquad \operatorname{var}(S_{30})=30\cdot 9=270. By normal approximation S30≈N(90,270)S_{30}\approx N(90,270) and P(S30≥78)=P ⁣(S30−90270≥78−90270)=P(Z≥−0.73)=1−Φ(−0.73)=Φ(0.73)≅0.77.P(S_{30}\ge 78)=P\!\left(\frac{S_{30}-90}{\sqrt{270}}\ge\frac{78-90}{\sqrt{270}}\right)=P(Z\ge -0.73)=1-\Phi(-0.73)=\Phi(0.73)\cong 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.950.95?

Now Sn=∑t=1nXtS_n=\sum_{t=1}^n X_t, with nn to be determined imposing P(Sn≥78)≥0.95.P(S_n\ge 78)\ge 0.95 . Again using the normal approximation, with E(Sn)=3nE(S_n)=3n and var⁡(Sn)=9n\operatorname{var}(S_n)=9n: P(Sn≥78)=P ⁣(Sn−3n3n≥78−3n3n)≥0.95,P(S_n\ge78)=P\!\left(\frac{S_n-3n}{3\sqrt n}\ge\frac{78-3n}{3\sqrt n}\right)\ge 0.95, where Sn−3n3n≈Z∼N(0,1)\frac{S_n-3n}{3\sqrt n}\approx Z\sim N(0,1). That is 1−Φ ⁣(78−3n3n)≥0.95  ⟺  Φ ⁣(78−3n3n)≤0.05  ⟺  Φ ⁣(3n−783n)≥0.95,1-\Phi\!\left(\frac{78-3n}{3\sqrt n}\right)\ge0.95\iff \Phi\!\left(\frac{78-3n}{3\sqrt n}\right)\le0.05\iff\Phi\!\left(\frac{3n-78}{3\sqrt n}\right)\ge0.95, i.e. 3n−783n≥1.65 ⟹ n≥36.\frac{3n-78}{3\sqrt n}\ge1.65\ \Longrightarrow\ \boxed{n\ge 36}.

Example 3 (sample size for a proportion)

(Xn)(X_n) iid Bernoulli b(p)b(p), X‾n=n1n\overline{X}_n=\frac{n_1}{n} (relative frequency of ones), with E(X‾n)=p,var⁡(X‾n)=p(1−p)n.E(\overline{X}_n)=p,\qquad\operatorname{var}(\overline{X}_n)=\frac{p(1-p)}{n}. Solve the same problem as before: how many observations nn are needed to guarantee P ⁣(∣n1n−p∣≤0.05)≥0.95 ?P\!\left(\left|\frac{n_1}{n}-p\right|\le0.05\right)\ge0.95\ ? By the normal approximation (the standardized quantity is ≈N(0,1)\approx N(0,1)): P ⁣(∣n1n−p∣≤0.05)=P ⁣(∣n1n−p∣p(1−p)/n≤0.05p(1−p)/n)=2Φ ⁣(0.05np(1−p))−1≥0.95,P\!\left(\left|\frac{n_1}{n}-p\right|\le0.05\right)=P\!\left(\frac{\left|\frac{n_1}{n}-p\right|}{\sqrt{p(1-p)/n}}\le\frac{0.05}{\sqrt{p(1-p)/n}}\right)=2\Phi\!\left(\frac{0.05\sqrt n}{\sqrt{p(1-p)}}\right)-1\ge0.95, or Φ ⁣(0.05np(1−p))≥0.975  implies  0.05np(1−p)≥1.96  or  n≥p(1−p)0.05⋅1.96.\Phi\!\left(\frac{0.05\sqrt n}{\sqrt{p(1-p)}}\right)\ge0.975\ \text{ implies }\ \frac{0.05\sqrt n}{\sqrt{p(1-p)}}\ge1.96\ \text{ or }\ \sqrt n\ge\frac{\sqrt{p(1-p)}}{0.05}\cdot1.96 . The worst case is p=12p=\frac12, corresponding to n=19.6\sqrt n=19.6, or n≈400n\approx400, to be compared with n≈2000n\approx2000 from Chebyshev's inequality.

Rule of thumb

Let (Xn)(X_n) be iid with E(X1)=μE(X_1)=\mu, var⁡(X1)=σ2\operatorname{var}(X_1)=\sigma^2. Then P ⁣(∣∑i=1nXi−nμσn∣≤1.96)≃0.95,P\!\left(\left|\frac{\sum_{i=1}^nX_i-n\mu}{\sigma\sqrt n}\right|\le1.96\right)\simeq0.95, i.e. P ⁣(∑i=1nXi∈[nμ−1.96 σn, nμ+1.96 σn])≃0.95.P\!\left(\sum_{i=1}^nX_i\in\big[n\mu-1.96\,\sigma\sqrt n,\ n\mu+1.96\,\sigma\sqrt n\big]\right)\simeq0.95 .

With Bernoulli random variables (rounding 1.961.96 to 22): P ⁣(n1∈[np−2p(1−p)n, np+2p(1−p)n])≃0.95.P\!\left(n_1\in\Big[np-2\sqrt{p(1-p)}\sqrt n,\ np+2\sqrt{p(1-p)}\sqrt n\Big]\right)\simeq0.95 .

Question: is the coin fair? If the coin is fair, then with probability ≃0.95\simeq0.95 n1∈[n2−n, n2+n].n_1\in\left[\frac n2-\sqrt n,\ \frac n2+\sqrt n\right]. Note that:

  • if n=1000n=1000, n1∈[469,531]n_1\in[469,531], half-width 3%3\%;
  • if n=106n=10^6, n1∈[499000,501000]n_1\in[499000,501000], half-width 1 per thousand.

The CLT is inescapable.

Versione ripasso

Setting. (Xn)(X_n) iid, E(X1)=μE(X_1)=\mu, var⁡(X1)=σ2<∞\operatorname{var}(X_1)=\sigma^2<\infty, X‾n=1n∑1nXi\overline{X}_n=\frac1n\sum_1^nX_i with E(X‾n)=μE(\overline{X}_n)=\mu, var⁡(X‾n)=σ2/n\operatorname{var}(\overline{X}_n)=\sigma^2/n.

LLN vs CLT. LLN: X‾n→Pμ\overline{X}_n\xrightarrow{P}\mu (degenerate limit, X‾n−μ→D\overline{X}_n-\mu\xrightarrow{D} unit step). CLT: amplify the error by n/σ\sqrt n/\sigma to get a non-trivial limit.

Theorem (Lindeberg-Levy). Wn=nσ(X‾n−μ)=X‾n−μσ/n→DN(0,1),W_n=\frac{\sqrt n}{\sigma}(\overline{X}_n-\mu)=\frac{\overline{X}_n-\mu}{\sigma/\sqrt n}\xrightarrow{D}N(0,1), with E(Wn)=0E(W_n)=0, var⁡(Wn)=1\operatorname{var}(W_n)=1 for all nn, whatever the distribution of the XnX_n. If the XnX_n are Gaussian, Wn∼N(0,1)W_n\sim N(0,1) exactly for every nn.

Proof idea. Wn=1n∑YiW_n=\frac1{\sqrt n}\sum Y_i, Yi=Xi−μσY_i=\frac{X_i-\mu}\sigma iid, mean 00, variance 11. Then φY1(ω)=1−ω22+o(ω2)\varphi_{Y_1}(\omega)=1-\frac{\omega^2}2+o(\omega^2) (derivatives at 00: jμY=0j\mu_{Y}=0, j2σY2=−1j^2\sigma_Y^2=-1), φWn(ω)=(1−ω2/2n+o(ω2n))n→e−ω2/2\varphi_{W_n}(\omega)=\big(1-\frac{\omega^2/2}{n}+o(\frac{\omega^2}{n})\big)^n\to e^{-\omega^2/2}, the CF of N(0,1)N(0,1); conclude with Levy's continuity theorem.

Gaussian approximation (large nn). ∑i=1nXi≈N(nμ,nσ2),X‾n≈N ⁣(μ,σ2n).\sum_{i=1}^nX_i\approx N(n\mu,n\sigma^2),\qquad\overline{X}_n\approx N\!\left(\mu,\frac{\sigma^2}n\right). Works for any sum of iid variables (also scaled or standardized).

Recipe. Compute mean and variance of the sum, standardize, use Φ\Phi.

  • Batteries: S30≈N(90,270)S_{30}\approx N(90,270), P(S30≥78)=Φ(0.73)≅0.77P(S_{30}\ge78)=\Phi(0.73)\cong0.77; for P(Sn≥78)≥0.95P(S_n\ge78)\ge0.95: 3n−783n≥1.65⇒n≥36\frac{3n-78}{3\sqrt n}\ge1.65\Rightarrow n\ge36.
  • Bernoulli: P(∣n1n−p∣≤0.05)≥0.95  ⟺  n≥1.96p(1−p)0.05P(|\frac{n_1}n-p|\le0.05)\ge0.95\iff\sqrt n\ge1.96\frac{\sqrt{p(1-p)}}{0.05}; worst case p=12p=\frac12: n≈400n\approx400 (Chebyshev: about 20002000).

Rule of thumb. P(∑Xi∈[nμ±1.96σn])≃0.95P\big(\sum X_i\in[n\mu\pm1.96\sigma\sqrt n]\big)\simeq0.95. Fair coin: n1∈[n2−n,n2+n]n_1\in[\frac n2-\sqrt n,\frac n2+\sqrt n] w.p. ≃0.95\simeq0.95 (n=1000n=1000: [469,531][469,531]).

Typical mistakes. Forgetting to standardize with σn\sigma\sqrt n (not σ/n\sigma/\sqrt n) for sums; using var⁡(Sn)=nσ\operatorname{var}(S_n)=n\sigma instead of nσ2n\sigma^2; reading P(Z≥−a)P(Z\ge-a) as 1−Φ(a)1-\Phi(a) (it is Φ(a)\Phi(a)); applying the approximation without independence or finite variance.

Teoria collegata