MIT 18.650 — Lecture 13

Method of Moments and Bootstrap

§ Method of Moments Estimator

Let's briefly discuss one last method of defining an estimator; we won't go into too much detail.

Definition. Given a random variable XX, its jthj^{\text{th}} moment is αj:=E[Xj]\alpha_j := \mathbb{E}[X^j].

This lets us define the Method of Moments Estimator.

MoM Estimator. We have (i.i.d.) samples {Xi}i=1nfθ\{X_i\}_{i = 1}^n \sim f_{\theta}, where θ=(θ1,θ2,,θk)\theta = (\theta_1, \theta_2, \dots, \theta_k) is a vector of all kk parameters of interest.

  1. First, estimate the first kk moments of XX via α^j=1ni=1nXij\hat{\alpha}_j = \frac{1}{n} \sum_{i = 1}^n X_i^j.

  2. This gives us kk equations {α^j=αj}\{\hat{\alpha}_j = \alpha_j\}, where the LHS of each equation is a sample moment, and the RHS is the corresponding population moment as a function of (θ1,θ2,,θk)(\theta_1, \theta_2, \dots, \theta_k).

  3. Since we have kk equations and kk unknowns, we can solve for (θ1,θ2,,θk)(\theta_1, \theta_2, \dots, \theta_k). This solution is our estimate.

Remark. The typical estimator θ^n:=Xˉn\hat{\theta}_n := \bar{X}_n for the mean of a distribution is an example of the k=1k = 1 case of an MoM estimator.

When solving the system of equations in closed form is not possible, we might resort to the Newton-Raphson method (e.g.), just as we did for computing the MLE.

It also turns out that the MoM estimator is consistent and asymptotically normal, with a computable asymptotic variance ΣMoM\Sigma^{\mathrm{MoM}}; roughly speaking, the asymptotic variance is found by applying the delta method to the inverse of the moment map. Note that the MoM estimator, unlike the MLE, need not attain the Cramér-Rao lower bound with equality.

§ Motivating Bootstrapping

We care about asymptotic variance of estimators because it's needed to write confidence intervals. Recall from Lecture 8:

Theorem. (Constructing CIs) Suppose θ^n\hat{\theta}_n is an asymptotically normal estimator of θ\theta with asymptotic variance σ2\sigma^2. Then:

Cn:=(θ^nzα/2σn,θ^n+zα/2σn)C_n := \left( \hat{\theta}_n - z_{\alpha / 2} \frac{\sigma}{\sqrt{n}}, \hat{\theta}_n + z_{\alpha / 2} \frac{\sigma}{\sqrt{n}} \right)

has asymptotic coverage (1α)(1 - \alpha), where zα/2z_{\alpha / 2} is such that Φ(zα/2)Φ(zα/2)=1α\Phi(z_{\alpha / 2}) - \Phi(-z_{\alpha / 2}) = 1 - \alpha.

There are three specific kinds of estimators we've discussed so far, and we know the asymptotic variance of all of them.

In general, though, it might not be so easy to find the asymptotic variance.

Example. Let θ\theta be the median of a distribution with a strictly positive PDF ff; formally, the unique θ\theta such that:

θf(x)dx=0.5.\int_{-\infty}^{\theta} f(x) \, \mathrm{d}x = 0.5.

We might naturally consider the estimator θ^n:=Median(X1,X2,,Xn)\hat{\theta}_n := \mathrm{Median}(X_1, X_2, \dots, X_n). But what is its asymptotic variance…?

We need another way to compute standard errors—that way is called bootstrapping.

§ Bootstrapping

The idea is to suppose we had BB batches of nn samples each. Then each of the BB batches gives its own value θ^b\hat{\theta}_b for the estimator.

{X1,1,X1,2,,X1,n}θ^1      {X2,1,X2,2,,X2,n}θ^2            {XB,1,XB,2,,XB,n}θ^B\{X_{1, 1}, X_{1, 2}, \dots, X_{1, n}\} \mapsto \hat{\theta}_1 ~~~ \parallel ~~~ \{X_{2, 1}, X_{2, 2}, \dots, X_{2, n}\} \mapsto \hat{\theta}_2 ~~~ \parallel ~~~ \dots ~~~ \parallel ~~~ \{X_{B, 1}, X_{B, 2}, \dots, X_{B, n}\} \mapsto \hat{\theta}_B

Remark. Previously, θ^n\hat{\theta}_n denoted the value of the estimator that results from taking nn samples. Now, θ^b\hat{\theta}_b denotes the value of the estimator from the bthb^{\text{th}} batch of samples.

We could then use these BB values {θ^b}b=1B\{\hat{\theta}_b\}_{b = 1}^B to estimate the variance of θ^n\hat{\theta}_n like so:

V[θ^n]^=1Bb=1B(θ^b1Bc=1Bθ^c)2\widehat{\mathbb{V}[\hat{\theta}_n]} = \frac{1}{B} \sum_{b = 1}^B \left( \hat{\theta}_b - \frac{1}{B} \sum_{c = 1}^B \hat{\theta}_c \right)^2

The issue, however, is that we might not have BnnBn \gg n total samples from the population. The trick is to consider the following.

Definition. Given nn samples {X1,,Xn}\{X_1, \dots, X_n\}, the empirical distribution is the probability distribution:

P^n:=Uniform({X1,,Xn}).\hat{\mathbb{P}}_n := \mathrm{Uniform}(\{X_1, \dots, X_n\}).

In other words, sampling from P^n\hat{\mathbb{P}}_n just returns one of the nn samples {Xi}i=1n\{X_i\}_{i = 1}^n uniformly at random.

Remark. Note that the distribution P^n\hat{\mathbb{P}}_n, itself, is random, because it depends on the values of random variables.

Definition. Given nn samples {X1,,Xn}\{X_1, \dots, X_n\}, a bootstrap sample is a collection of mm random variables {X1,,Xm}\{X_1^*, \dots, X_m^*\} sampled (i.i.d.) from P^n\hat{\mathbb{P}}_n.

Example. Given the n=3n = 3 samples {5.2,7.3,6.8}\{5.2, 7.3, 6.8\}, one possible bootstrap sample of size m=4m = 4 is {7.3,7.3,6.8,7.3}\{7.3, 7.3, 6.8, 7.3\}.

Thus, instead of independent real batches, we can just take BB bootstrap samples of size nn.

§ Example: Bootstrapping the Median

Let's use the estimator θ^n:=Median(X1,,Xn)\hat{\theta}_n := \mathrm{Median}(X_1, \dots, X_n) to estimate the median of a mystery distribution P\mathbb{P}, then use bootstrapping to estimate the asymptotic variance of θ^n\hat{\theta}_n. Say we take n=5n = 5 samples, and they come out as:

{X1,X2,X3,X4,X5}={0.3,0.5,0.9,1.4,3.1}.\{X_1, X_2, X_3, X_4, X_5\} = \{0.3, 0.5, 0.9, 1.4, 3.1\}.

Then the observed point estimate (call it θ^0\hat{\theta}_0, for the original sample) is θ^0=0.9\hat{\theta}_0 = 0.9. Now we draw B=4B = 4 bootstrap samples of size m=5m = 5 from the empirical distribution P^5\hat{\mathbb{P}}_5 and compute the median of each.

{0.5,3.1,0.9,0.5,1.4}θ^1=0.9{0.3,0.3,1.4,0.9,0.3}θ^2=0.3{1.4,0.9,3.1,1.4,0.5}θ^3=1.4{0.9,0.5,0.3,3.1,0.9}θ^4=0.9\begin{align*}\{0.5,\, 3.1,\, 0.9,\, 0.5,\, 1.4\} &\mapsto \hat{\theta}_1 = 0.9 \\ \{0.3,\, 0.3,\, 1.4,\, 0.9,\, 0.3\} &\mapsto \hat{\theta}_2 = 0.3 \\ \{1.4,\, 0.9,\, 3.1,\, 1.4,\, 0.5\} &\mapsto \hat{\theta}_3 = 1.4 \\ \{0.9,\, 0.5,\, 0.3,\, 3.1,\, 0.9\} &\mapsto \hat{\theta}_4 = 0.9\end{align*}

Remark. The size m=5m = 5 of the bootstrap samples really should be the same as the total number n=5n = 5 of samples. Otherwise, our bootstrap samples would be describing the spread of θ^m\hat{\theta}_m, not θ^n\hat{\theta}_n.

The four medians average to 14(0.9+0.3+1.4+0.9)=0.875\frac{1}{4}(0.9 + 0.3 + 1.4 + 0.9) = 0.875, so their variance is:

vboot=(0.90.875)2+(0.30.875)2+(1.40.875)2+(0.90.875)240.1519.v_{\mathrm{boot}} = \frac{(0.9 - 0.875)^2 + (0.3 - 0.875)^2 + (1.4 - 0.875)^2 + (0.9 - 0.875)^2}{4} \approx 0.1519.

Thus, our estimate of the asymptotic variance of θ^n\hat{\theta}_n is σ^2=nvboot0.76\hat{\sigma}^2 = n \cdot v_{\mathrm{boot}} \approx 0.76.

Remark. To be explicit about the exact reason why bootstrapping works…

Altogether, this means nvbootn \cdot v_{\mathrm{boot}} is indeed a reasonable estimator of the asymptotic variance σ2\sigma^2.

Next lecture, we'll see how computing this asymptotic variance will be helpful towards constructing confidence intervals.

Remark. Recall that a confidence interval only really cares about VP[θ^n]\mathbb{V}_{\mathbb{P}}[\hat{\theta}_n] itself; the asymptotic variance σ2\sigma^2 is just an alternative nn-scaled way of interpreting it.

Consequently, the next lecture on confidence intervals can avoid using the “third bullet point” and rely instead only on the approximation vbootVθ[θ^n]v_{\mathrm{boot}} \approx \mathbb{V}_{\theta}[\hat{\theta}_n].

The upshot of this is that the caveat from Lecture 8 will not be relevant to the “pivotal CI” at all! (Though it will still be relevant for the “normal approximation CI”.)