MIT 18.650 — Lectures 1–3

Random Variables and Convergence

§ Preliminaries

First, getting some jargon and preliminary facts out of the way.

Theorem. (Linearity) For any random variables AA and BB, we have E[A+B]=E[A]+E[B]\mathbb{E}[A + B] = \mathbb{E}[A] + \mathbb{E}[B]. Furthermore, if AA and BB are independent, then V[A+B]=V[A]+V[B]\mathbb{V}[A + B] = \mathbb{V}[A] + \mathbb{V}[B].

Remark. If AA and BB are not independent, a counterexample to the latter of the two statements is A=BA = B, say.

An immediate corollary of the above fact is the following.

Theorem. (Sample Mean Stats) Suppose X1,X2,,XnPX_1, X_2, \dots, X_n \sim \mathbb{P} are sampled i.i.d., yielding a sample mean Xˉn\bar{X}_n. Suppose further that E[Xi]=μ\mathbb{E}[X_i] = \mu and V[Xi]=σ2\mathbb{V}[X_i] = \sigma^2. Then E[Xˉn]=μ\mathbb{E}[\bar{X}_n] = \mu and V[Xˉn]=σ2/n\mathbb{V}[\bar{X}_n] = \sigma^2 / n.

§ Convergence Definitions

Definition (Convergence in Probability). Given random variables {Xn}n=1\{X_n\}_{n = 1}^{\infty} and a random variable XX, we say “XnX_n converges to XX in probability” (denoted XnPXX_n \convprob X) if:

For every ϵ>0\epsilon > 0, we have Pr(XnX>ϵ)0\Pr(|X_n - X| > \epsilon) \to 0 as nn \to \infty.

Definition (Convergence in Distribution). Given random variables {Xn}n=1\{X_n\}_{n = 1}^{\infty} and a random variable XX, we say “XnX_n converges to XX in distribution” (denoted XnXX_n \rightsquigarrow X) if:

For all xx where xPr(Xx)x \mapsto \Pr(X \leq x) is continuous, we have Pr(Xnx)Pr(Xx)\Pr(X_n \leq x) \to \Pr(X \leq x) as nn \to \infty.

Remark. Think of “convergence in distribution” as saying that the CDFs of XnX_n and XX get sufficiently close together.

Example. Consider independent XnBer(12)X_n \sim \text{Ber}(\frac{1}{2}) and XBer(12)X \sim \text{Ber}(\frac{1}{2}). Then XnXX_n \rightsquigarrow X is true, but XnPXX_n \convprob X is not.

Expectedly, convergence in distribution is much less strict than convergence in probability. Here's a not-completely-obvious theorem.

Theorem. (Relationship Between Convergence) If XnPXX_n \convprob X, then XnXX_n \rightsquigarrow X.

Remark. Convergence in probability is possible… but it's really uncommon.

These examples feel kind of hacky, though—and it turns out, they have to be!

Fact. If XnXX_n \perp X for all nn and XnPXX_n \convprob X, then Pr(X=c)=1\Pr(X = c) = 1 for some constant cc.

This isn't explicitly in the 18.650 curriculum, but we'll prove it later anyway, once we learn what we need to do so.

Here's a completely-obvious theorem.

Theorem. (Convergence to Constant) We have XnPcX_n \convprob c if and only if XncX_n \rightsquigarrow c.

§ LLN and CLT

Theorem. (Weak Law of Large Numbers) Consider i.i.d. random variables X1,X2,X_1, X_2, \dots satisfying E[Xi]=μ\mathbb{E}[X_i] = \mu. Then their sample mean Xˉn\bar{X}_n converges in probability to μ\mu; that is, XˉnPμ\bar{X}_n \convprob \mu.

Proof: Chebyshev's, assuming finite variance; the point is that V[Xˉn]0\mathbb{V}[\bar{X}_n] \to 0 as nn \to \infty.   \blacksquare

Remark. The “Strong Law of Large Numbers” roughly says, more strongly, that Pr(limnXˉn=μ)=1\Pr(\lim_{n \to \infty} \bar{X}_n = \mu) = 1.

Theorem. (Central Limit Theorem) Given {Xi}i=1n\{X_i\}_{i = 1}^n i.i.d. with mean μ\mu and variance σ2\sigma^2, we have:

nσ(Xˉnμ)N(0,1),  or equivalently (hand-waving),  XˉnN(μ,σ2n).\dfrac{\sqrt{n}}{\sigma}(\bar{X}_n - \mu) \rightsquigarrow \mathcal{N}(0, 1), ~ \text{ or equivalently (hand-waving), } ~ \bar{X}_n \approx \mathcal{N}\left(\mu, \dfrac{\sigma^2}{n}\right).

Remark. We use some shorthand here: XPX \rightsquigarrow \mathbb{P} is short for XYPX \rightsquigarrow Y \sim \mathbb{P}.

You can at least sanity-check CLT; the E\mathbb{E} and V\mathbb{V} clearly match. But the proof is very nontrivial.

§ Convergence Properties

The former of these two bullets is not hard to prove; the latter is pretty hard.

Theorem. (Convergence of Sums and Products) Consider {Xn}n=1\{X_n\}_{n = 1}^{\infty}, {Yn}n=1\{Y_n\}_{n = 1}^{\infty}, XX, and YY random variables.

Remark. Consider the following false statement.

If XnXX_n \rightsquigarrow X and YnYY_n \rightsquigarrow Y, then Xn+YnX+YX_n + Y_n \rightsquigarrow X + Y.

A counterexample is Xn,X,YN(0,1)X_n, X, Y \sim \mathcal{N}(0, 1) with XYX \perp Y, and Yn=XnY_n = -X_n.

To prove things about convergence, it helps to know the following fact.

Theorem. (Continuous Mapping Theorem) If XnPXX_n \convprob X, then g(Xn)Pg(X)g(X_n) \convprob g(X) for any continuous function gg. Similarly, if XnXX_n \rightsquigarrow X, then g(Xn)g(X)g(X_n) \rightsquigarrow g(X).

§ The Delta Method

This lets us justify the so-called “Delta method”.

Theorem. (Delta Method) Consider a sequence of random variables YnY_n such that nσ(Ynμ)YN(0,1)\frac{\sqrt{n}}{\sigma}(Y_n - \mu) \rightsquigarrow Y \sim \mathcal{N}(0, 1). Then for any differentiable gg such that g(μ)0g'(\mu) \neq 0, we have:

nσ(g(Yn)g(μ))N(0,g(μ)2).\dfrac{\sqrt{n}}{\sigma} \left(g(Y_n) - g(\mu)\right) \rightsquigarrow \mathcal{N}(0, g'(\mu)^2).

(Naturally, you should think to use the Delta method for Yn=XˉnY_n = \bar{X}_n.)

More intuitively, the Delta method is just the CLT with a gg attached; when g(x)=xg(x) = x, the Delta method is the CLT verbatim.

Proof: Just Taylor expand gg around μ\mu.

nσ(g(Yn)g(μ))=g(μ)[nσ(Ynμ)]+nσRn.\dfrac{\sqrt{n}}{\sigma} \left(g(Y_n) - g(\mu)\right) = g'(\mu)\left[\dfrac{\sqrt{n}}{\sigma}(Y_n - \mu)\right] + \dfrac{\sqrt{n}}{\sigma}R_n.

The first term, by CLT, converges (\rightsquigarrow) to N(0,g(μ)2)\mathcal{N}(0, g'(\mu)^2). The second term converges (P\convprob) to 00.   \blacksquare

§ Applying Convergence Theorems

Here's the set-up.

Set-Up. Someone claims Harvard grads have a mean salary of below 120120K. To test this, you collect X1,X2,,X100X_1, X_2, \dots, X_{100} salaries (i.i.d.) and find that Xˉn=121\bar{X}_n = 121K and σ^=0.3\hat{\sigma} = 0.3K (in thousands).

You'd like to say XˉnN(120,0.32/100)\bar{X}_n \approx \mathcal{N}(120, 0.3^2/100); this would let you compute Pr(Xˉn121)\Pr(\bar{X}_n \geq 121) using the normal distribution.

But the CLT doesn't immediately apply here—the true standard deviation isn't known to be σ^\hat{\sigma}. What now?

Remark. As a reminder, the sample standard deviation σ^\hat{\sigma} is the same as sn2\sqrt{s_n^2}, where sn2s_n^2 is the sample variance.

The point is that Slutsky's Theorem lets us say XˉnN(120,0.32/100)\bar{X}_n \approx \mathcal{N}(120, 0.3^2/100) anyway, even though we don't know the exact value of σ\sigma.

Theorem. (Sample Variance is Unbiased) We have E[sn2]=σ2\mathbb{E}[s_n^2] = \sigma^2, where sn2:=1n1i=1n(XiXˉn)2s_n^2 := \frac{1}{n - 1} \sum_{i = 1}^n (X_i - \bar{X}_n)^2 is the sample variance.

Proof: Just expand everything and apply linearity. The details look like this:

E[i=1n(XiXˉn)2]=E[i=1n(Xiμ)2]E[2(Xˉnμ)i=1n(Xiμ)n(Xˉnμ)2]=E[i=1n(Xiμ)2]nσ2E[n(Xˉnμ)2]n(σ2n)=(n1)σ2.\begin{align*}\mathbb{E}\left[\sum_{i = 1}^n (X_i - \bar{X}_n)^2\right] & = \mathbb{E}\left[ \sum_{i = 1}^n (X_i - \mu)^2 \right] - \mathbb{E}\left[2(\bar{X}_n - \mu)\sum_{i = 1}^n (X_i - \mu) - n(\bar{X}_n - \mu)^2\right] \\ & = \underbrace{\mathbb{E}\left[ \sum_{i = 1}^n (X_i - \mu)^2 \right]}_{n \sigma^2} - \underbrace{\mathbb{E}\left[n(\bar{X}_n - \mu)^2\right]}_{n\left(\frac{\sigma^2}{n}\right)} = (n - 1)\sigma^2.\end{align*}

And that's why the sample variance has a 1n1\frac{1}{n - 1} factor; if it were 1n\frac{1}{n}, it would no longer be unbiased!   \blacksquare

Unbiasedness alone says nothing about large nn, so we need one more fact.

Theorem. (Sample Variance is Consistent) Assuming σ2<\sigma^2 < \infty, we have sn2Pσ2s_n^2 \convprob \sigma^2.

Proof: The Law of Large Numbers doesn't apply to sn2s_n^2 as written, since sn2s_n^2 is not the mean of i.i.d. sampled random variables. Let's rewrite sn2s_n^2 to fix that.

sn2=1n1[i=1n(XiXˉn)2]=1n1[(i=1nXi2)nXˉn2]=nn1[(1ni=1nXi2)Xˉn2].s_n^2 = \frac{1}{n - 1} \left[ \sum_{i = 1}^n (X_i - \bar{X}_n)^2 \right] = \frac{1}{n - 1} \left[ \left(\sum_{i = 1}^n X_i^2\right) - n \cdot \bar{X}_n^2 \right] = \frac{n}{n - 1} \left[ \left(\frac{1}{n}\sum_{i = 1}^n X_i^2\right) - \bar{X}_n^2 \right].

Now the Law of Large Numbers does apply, twice:

Convergence of Sums then handles the bracketed part of sn2s_n^2.

(1ni=1nXi2)Xˉn2PE[X12]μ2=σ2.\left(\frac{1}{n}\sum_{i = 1}^n X_i^2\right) - \bar{X}_n^2 \convprob \mathbb{E}[X_1^2] - \mu^2 = \sigma^2.

As for the leftover nn1\frac{n}{n - 1} factor, note that nn1P1\frac{n}{n - 1} \convprob 1, so convergence of products yields sn2P1σ2=σ2s_n^2 \convprob 1 \cdot \sigma^2 = \sigma^2, as desired.   \blacksquare

With the above, we can justify XˉnN(120,0.32/100)\bar{X}_n \approx \mathcal{N}(120, 0.3^2/100) as follows:

  1. By consistency of the sample variance, sn2Pσ2s_n^2 \convprob \sigma^2.

  2. Then the Continuous Mapping Theorem (with g(x)=xg(x) = \sqrt{x}) gives σ^Pσ\hat{\sigma} \convprob \sigma. In other words, σσ^P1\frac{\sigma}{\hat{\sigma}} \convprob 1.

  3. Also, the Central Limit Theorem tells us nσ(Xˉnμ)N(0,1)\frac{\sqrt{n}}{\sigma} (\bar{X}_n - \mu) \rightsquigarrow \mathcal{N}(0, 1).

  4. Applying Slutsky's Theorem on points 2 and 3 yields nσ^(Xˉnμ)N(0,1)\frac{\sqrt{n}}{\hat{\sigma}} (\bar{X}_n - \mu) \rightsquigarrow \mathcal{N}(0, 1), done!

§ Convergence in Probability is Hard

To close things off, let's prove that not-in-18.650-curriculum fact from earlier.

Theorem. (Convergence in Probability is Hard) If XnXX_n \perp X for all nn and XnPXX_n \convprob X, then Pr(X=c)=1\Pr(X = c) = 1 for some constant cc.

Proof: We may assume XnX_n and XX are bounded; if they're not, just replace them with tan1(Xn)\tan^{-1}(X_n) and tan1(X)\tan^{-1}(X), legal by the Continuous Mapping Theorem. Then the independence yields:

E[X2]E[XnX]=E[Xn]E[X]E[X]2.\mathbb{E}[X^2] \leftarrow \mathbb{E}[X_n \cdot X] = \mathbb{E}[X_n] \cdot \mathbb{E}[X] \rightarrow \mathbb{E}[X]^2.

Letting nn \to \infty, we get E[X2]=E[X]2\mathbb{E}[X^2] = \mathbb{E}[X]^2, or V[X]=0\mathbb{V}[X] = 0, which implies XX is almost surely constant.   \blacksquare

Remark. The convergence in probability—not true in convergence in distribution—comes from the step XnXPX2X_n \cdot X \convprob X^2.