Skip to main content

9  Convergence and limit theorems

Why does a sample average estimate an expectation? Why does measurement noise often appear approximately normal, even when the original observations are not? Two limit theorems answer these questions, but they make different statements. The law of large numbers concerns the eventual closeness of an average to a constant. The central limit theorem concerns the distribution of its remaining fluctuations.

9.1 Probability inequalities

Markov’s inequality. If \(Y\ge0\) and \(a>0\), then

\[ P(Y\ge a)\le\frac{E[Y]}{a}. \]

Proof: \(Y\ge a\mathbf1_{\{Y\ge a\}}\) pointwise. Taking expectations preserves the inequality. This bound needs no distributional shape assumption.

Chebyshev’s inequality. For \(X\) with finite mean \(\mu\) and variance \(\sigma^2\),

\[ P(|X-\mu|\ge\epsilon) \le\frac{\sigma^2}{\epsilon^2},\qquad\epsilon>0. \]

Apply Markov’s inequality to \((X-\mu)^2\) with threshold \(\epsilon^2\). A bound above one is valid but uninformative; one can always take the minimum of it and one.

For example, a load sensor has mean 80 and standard deviation two, but its distribution is unknown. Chebyshev says that the probability of a value more than ten units from 80 is at most \(4/100=0.04\). A normal assumption might give a much smaller probability, but the inequality is valid for all finite-variance distributions with those moments.

9.2 Four modes of convergence

Consider random variables \(X_1,X_2,\ldots\) and \(X\).

  • Almost sure convergence, \(X_n\to X\) a.s., means \(P(\{\omega:\lim_n X_n(\omega)=X(\omega)\})=1\).
  • Convergence in probability, \(X_n\xrightarrow{P} X\), means for every \(\epsilon>0\), \(P(|X_n-X|>\epsilon)\to0\).
  • Mean-square convergence, \(X_n\xrightarrow{L^2} X\), means \(E[(X_n-X)^2]\to0\).
  • Convergence in distribution, \(X_n\xrightarrow{d} X\), means \(F_{X_n}(x)\to F_X(x)\) at every continuity point of \(F_X\).

Almost sure convergence concerns individual sample paths; convergence in probability concerns the probability of a discrepancy at each sample size. Convergence in distribution compares marginal distributions and does not require the variables to be on the same probability space.

flowchart TD
    A["Almost surely"] --> P["In probability"]
    L["Mean square"] --> P
    P --> D["In distribution"]

Why these implications hold. Mean-square convergence implies convergence in probability by Markov applied to the squared discrepancy. Almost sure convergence implies convergence in probability by dominated convergence of the indicator \(\mathbf1_{\{|X_n-X|>\epsilon\}}\), bounded by one. To show convergence in probability implies convergence in distribution, observe that for any \(\delta>0\),

\[ \begin{aligned} P(X\le x-\delta)-P(|X_n-X|>\delta) &\le P(X_n\le x)\\ &\le P(X\le x+\delta)+P(|X_n-X|>\delta). \end{aligned} \]

First let \(n\to\infty\), then \(\delta\downarrow0\) at a continuity point of \(F_X\). The bounds meet. The reverse implications are false in general. However, convergence in distribution to a constant implies convergence in probability to that constant (bound the two tails using the limiting CDF).

Take an independent fair sign \(X\in\{-1,1\}\) and set \(X_n=-X\) for all \(n\). All \(X_n\) have the same distribution as \(X\), so they converge in distribution to \(X\), although their distance from \(X\) is always two.

9.3 The laws of large numbers

Let \(X_1,\ldots,X_n\) be iid with \(E[X_i]=\mu\) and finite variance \(\sigma^2\). Define the sample mean \(\bar X_n=n^{-1}\sum_{i=1}^nX_i\).

Independence implies

\[ E[\bar X_n]=\mu,\qquad \operatorname{Var}(\bar X_n)=\frac{\sigma^2}{n}. \]

By Chebyshev,

\[ P(|\bar X_n-\mu|\ge\epsilon) \le\frac{\sigma^2}{n\epsilon^2}\longrightarrow0. \]

This proves the weak law of large numbers (WLLN) for iid variables of finite variance. It also proves mean-square convergence.

The strong law of large numbers (SLLN) states that for iid variables satisfying \(E|X_1|<\infty\), \(\bar X_n\to E[X_1]\) almost surely. Here is a proof for the important finite-variance case.

Let \(S_j=\sum_{i=1}^j(X_i-\mu)\). For independent centered summands, the maximal inequality

\[ P\left(\max_{j\le m}|S_j|\ge a\right) \le\frac{m\sigma^2}{a^2} \]

follows by partitioning the crossing event into disjoint events \(A_j\) where the first crossing occurs at \(j\). On \(A_j\), \(S_j^2\ge a^2\) and the future increment \(S_m-S_j\) is independent of \(A_j\) and \(S_j\), with mean zero. Expanding \(S_m^2\) inside \(E[S_m^2\mathbf1_{A_j}]\) shows that the cross term vanishes and the remaining terms are at least \(a^2P(A_j)\). Sum over \(j\) and use \(E[S_m^2]=m\sigma^2\).

Now set \(m=2^k\), \(a=\epsilon 2^{k-1}\). The probabilities of these maximal crossings are at most \(4\sigma^2/(\epsilon^2 2^k)\), a summable sequence. The first Borel–Cantelli lemma says summable event probabilities imply only finitely many of those events occur almost surely: indeed the probability of any event after index \(K\) is bounded by the tail of the probability series, which tends to zero. Thus, almost surely, for all sufficiently large \(k\),

\[ \left|\frac{S_n}{n}\right|<\epsilon \quad\text{for all }2^{k-1}\le n\le2^k. \]

Intersecting the resulting probability-one events for \(\epsilon=1,1/2,1/3,\ldots\) proves the strong law in this case. The general integrable iid theorem needs a truncation argument beyond this proof.

Eight curves show running means fluctuating and then approaching one as sample size grows.
Figure 9.1: Several independent running averages of exponential observations settle near their population mean.

9.4 The central limit theorem

Suppose \(X_i\) are iid, \(E[X_i]=\mu\), and \(0<\sigma^2<\infty\). The central limit theorem (CLT) states

\[ Z_n=\frac{\sqrt n(\bar X_n-\mu)}{\sigma} \xrightarrow{d}N(0,1). \]

The normalization makes \(E[Z_n]=0\) and \(\operatorname{Var}(Z_n)=1\) for every \(n\). The surprise is not the moments, but the limiting shape.

9.4.1 Proof using characteristic functions

Write \(Y_i=(X_i-\mu)/\sigma\), with mean zero and second moment one. From Chapter 8, \(\varphi_Y(t)=E[e^{itY}]\). Taylor expansion near zero gives

\[ \varphi_Y(u)=1-\frac{u^2}{2}+o(u^2). \]

Only the second moment is needed for this expansion: write \(e^{iv}=1+iv-v^2/2+r(v)\), where \(r(v)/v^2\to0\) as \(v\to0\) and \(|r(v)/v^2|\) is bounded on the real line (extend continuously at zero). Thus \(E[r(uY)]/u^2=E[Y^2r(uY)/(uY)^2]\to0\) by dominated convergence. The linear term vanishes because the mean is zero.

Independence of the \(Y_i\) gives

\[ \begin{aligned} \varphi_{Z_n}(t) &=[\varphi_Y(t/\sqrt n)]^n\\ &=\left[1-\frac{t^2}{2n}+o(1/n)\right]^n\\ &\longrightarrow e^{-t^2/2}. \end{aligned} \]

The last limit follows from the exponential limit \((1+c/n)^n\to e^c\) (also valid for a bounded complex sequence \(c_n\to c\)). The limiting function is the characteristic function of the standard normal, as obtained by the Gaussian integral. Lévy’s continuity theorem states that pointwise convergence of characteristic functions to a characteristic function continuous at zero implies convergence in distribution. Applying it proves the CLT. \(\square\)

We have used one standard theorem from advanced probability, but all algebra and moment assumptions in this CLT derivation are explicit.

9.4.2 Example: a service desk’s mean waiting time

Suppose a job’s waiting time is exponential with mean five minutes and standard deviation five minutes. A sample of 100 independent jobs has mean with standard error \(5/\sqrt{100}=0.5\) minutes. The CLT approximation for its mean exceeding 5.8 is

\[ P(\bar X_{100}>5.8)\approx1-\Phi(1.6)\approx0.0548. \]

No individual waiting time is normal. The approximation is about the standardized mean. For exponential observations the exact sum is gamma, so we can check the approximation against an exact value.

from scipy import stats

n, mean = 100, 5
threshold = 5.8
normal = stats.norm.sf((threshold-mean)/(mean/n**.5))
exact = stats.gamma.sf(n*threshold, a=n, scale=mean)
print("CLT:", normal, "Exact:", exact)
Three histogram panels for sample sizes two, ten and one hundred, increasingly matching a standard normal curve.
Figure 9.2: Standardized means of strongly skewed exponential observations become closer to a bell curve as sample size increases.

9.5 Studentization and smooth transformations

Slutsky’s theorem allows constants in large-sample limits to be replaced by consistent estimators. If \(A_n\xrightarrow d A\) and \(B_n\xrightarrow P b\) for a constant \(b\ne0\), then \(A_n/B_n\xrightarrow d A/b\). In particular, the sample standard deviation \(S_n\) is consistent for \(\sigma\) under iid finite second moments: apply the LLN to \(X_i\) and \(X_i^2\) in \(S_n^2=n/(n-1)(\overline{X^2}-\bar X_n^2)\). Thus

\[ \frac{\sqrt n(\bar X_n-\mu)}{S_n}\xrightarrow d N(0,1). \]

The delta method states that if \(\sqrt n(T_n-\theta)\xrightarrow d N(0,v)\) and \(g\) is differentiable at \(\theta\), then

\[ \sqrt n[g(T_n)-g(\theta)] \xrightarrow d N(0,[g'(\theta)]^2v). \]

Proof: by differentiability the difference is \(g'(\theta)(T_n-\theta)+o(|T_n-\theta|)\). Multiply by \(\sqrt n\). The remainder converges to zero in probability because \(T_n\to\theta\) in probability and \(\sqrt n(T_n-\theta)\) is bounded in probability by convergence in distribution; apply Slutsky. If \(g'(\theta)=0\), this first-order limit is degenerate and a finer expansion may be necessary.

For example, for a positive mean \(\mu\), \(g(x)=\log x\) has derivative \(1/\mu\). The asymptotic variance of \(\log\bar X_n\) is approximately \(\sigma^2/(n\mu^2)\).

9.6 When the assumptions matter

CLT approximation quality depends on the distribution, sample size, and tail region. There is no universal rule that \(n=30\) suffices. Dependent data require a different argument; infinite variance can invalidate the stated scaling.

A standard Cauchy variable has no finite mean. The average of independent standard Cauchy variables is still standard Cauchy, since their characteristic function is \(e^{-|t|}\). Taking more observations does not concentrate that average.

9.7 Practice problems

Work in your browser with Google Colab, or download the notebooks for Jupyter.

Practice notebook

Open in Colab Download .ipynb

Worked solutions

Open in Colab Download .ipynb

9.7.1 Exercise 1: A distribution-free guarantee

Suppose iid measurements have variance nine. How large must \(n\) be for Chebyshev’s inequality to guarantee \(P(|\bar X_n-\mu|\ge0.5)\le0.05\)?

The bound is \(9/(n\cdot0.25)=36/n\). Requiring \(36/n\le0.05\) gives \(n\ge720\). This is a sufficient sample size, not necessarily the smallest true requirement.

9.7.2 Exercise 2: Which convergence?

Let \(U\sim\operatorname{Uniform}(0,1)\) and \(X_n=n\) if \(U<1/n\), zero otherwise. Show almost sure convergence to zero but failure of mean-square convergence.

For every \(U>0\) there is a finite index after which \(1/n<U\), so \(X_n=0\) eventually. Since \(P(U>0)=1\), convergence is almost sure. Yet \(E[X_n^2]=n^2 P(U<1/n)=n\to\infty\), so there is no mean-square convergence to zero.

9.7.3 Exercise 3: A delta-method standard error

An iid sample of size 400 is drawn from \(\operatorname{Exponential}(2)\). Use the delta method to approximate the standard error of \(1/\bar X\).

Here \(\mu=1/2,\sigma^2=1/4\), and \(g'(\mu)=-1/\mu^2=-4\). The approximate variance is \(16(1/4)/400=0.01\), so the standard error is \(0.1\). The estimator converges to rate two even though its finite-sample expectation is not exactly two.

9.7.4 Exercise 4: Observe the LLN (Python)

Simulate twelve independent paths of 3,000 Poisson(4) counts. Plot each running average. At \(n=100,1000,3000\), estimate the theoretical standard error and interpret the plot.

import numpy as np
import matplotlib.pyplot as plt

rng = np.random.default_rng(901)
x = rng.poisson(4, (12, 3000))
n = np.arange(1, x.shape[1]+1)
running = np.cumsum(x, axis=1)/n
plt.plot(n, running.T, alpha=.5)
plt.axhline(4, color="black", linestyle="--")
plt.xscale("log")
plt.xlabel("Sample size")
plt.ylabel("Running average")
plt.show()
print(np.sqrt(4/np.array([100, 1000, 3000])))

The standard errors decrease as \(n^{-1/2}\), not \(n^{-1}\). Paths can still fluctuate; convergence does not imply monotone improvement.

9.7.5 Exercise 5: Check the CLT for a skewed model (Python)

Generate 20,000 standardized means of exponential(1) samples of sizes 2, 10, and 100. Compare the histograms and sample skewnesses to the standard normal.

import numpy as np
from scipy import stats
import matplotlib.pyplot as plt

rng = np.random.default_rng(902)
g = np.linspace(-4, 5, 300)
fig, axes = plt.subplots(1, 3, figsize=(10, 3))
for ax, n in zip(axes, [2, 10, 100]):
    z = (rng.exponential(size=(20_000,n)).mean(axis=1)-1)*np.sqrt(n)
    print(n, "skewness:", stats.skew(z), "theory:", 2/np.sqrt(n))
    ax.hist(z, bins=55, density=True, alpha=.55)
    ax.plot(g, stats.norm.pdf(g))
    ax.set(title=f"n={n}", xlim=(-4,5))
plt.tight_layout()
plt.show()

Skewness decreases as \(2/\sqrt n\), consistent with the gamma distribution of the sum. The normal curve becomes a useful approximation.

9.7.6 Exercise 6: A heavy-tail counterexample (Python)

Compare the sample means of standard normals and standard Cauchy variables for \(n=5,100,1000\). For each, simulate 5,000 repetitions and print the interquartile range of the means. Avoid using the empirical Cauchy variance as a concentration metric.

import numpy as np
from scipy import stats

rng = np.random.default_rng(903)
for n in [5, 100, 1000]:
    normal_means = rng.normal(size=(5000,n)).mean(axis=1)
    cauchy_means = rng.standard_cauchy((5000,n)).mean(axis=1)
    print(n, "normal IQR", stats.iqr(normal_means),
          "Cauchy IQR", stats.iqr(cauchy_means))

The theoretical normal IQR is approximately \(1.349/\sqrt n\); the Cauchy IQR remains two for every \(n\). This illustrates why a limit theorem must be interpreted together with its hypotheses.