Properties of estimators — step-by-step proofs of bias, MSE, the uniform’s maximum, Cramér–Rao and consistency (and the squared error smaller than the variance)

In a class mock exam I was asked for the mean squared error of the maximum of a uniform, and I got one smaller than its variance. I had written MSE=Var+b \text{MSE} = \text{Var} + b instead of Var+b2 \text{Var} + b^2 , and since the bias of the maximum is negative, adding it made the total error go down. The lecturer did not cross out the working: he just wrote next to it “a mean error smaller than the scatter?”. Nothing more was needed. An MSE can never be smaller than the variance, because what you add to it is a square. Since then, I check every result in this topic with a question like that before accepting it.

In the properties of estimators theory we saw what bias, MSE, the Cramér–Rao bound and consistency are, and we checked them by simulation with the rental scooter fleet in Las Palmas. Here is why each result is true, step by step, with no jumps. These are the proofs that come up in the EC2: proving that an estimator is unbiased, computing its MSE, comparing two of them, seeing whether one reaches the bound and whether it is consistent. After each one, “Check it with R” tests it against numbers.

Table of Contents

Before you start: the rules we will use

Every step of the proofs is justified by one of these rules. I quote them by number (“by rule 3”).

  1. Linearity of expectation: E(aX+b)=aE(X)+b E(aX + b) = aE(X) + b and E(∑Xi)=∑E(Xi) E\left(\sum X_i\right) = \sum E(X_i) , independent or not.
  2. Variance of transformations and sums: Var(aX+b)=a2 Var(X) \text{Var}(aX + b) = a^2\,\text{Var}(X) and, if the Xi X_i are independent, Var(∑Xi)=∑Var(Xi) \text{Var}\left(\sum X_i\right) = \sum \text{Var}(X_i) . Together they give Var(Xˉ)=σ2/n \text{Var}(\bar X) = \sigma^2/n .
  3. The second moment: Var(X)=E(X2)−E(X)2 \text{Var}(X) = E(X^2) – E(X)^2 , so E(X2)=Var(X)+E(X)2 E(X^2) = \text{Var}(X) + E(X)^2 .
  4. Independence: if X1,…,Xn X_1, \dots, X_n are independent, P(X1≤x,…,Xn≤x)=P(X1≤x)⋯P(Xn≤x) P(X_1 \le x, \dots, X_n \le x) = P(X_1 \le x) \cdots P(X_n \le x) .
  5. Expectation of a function: E(g(X))=∫g(x)f(x) dx E(g(X)) = \int g(x) f(x)\,dx (or ∑g(x) p(x) \sum g(x)\,p(x) if X is discrete).
  6. The chi-squared of the variance: in a normal population, (n−1)S2σ2∼χn−12 \frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1} , and a χk2 \chi^2_k has mean k and variance 2k (we saw it in sampling distributions).
  7. Gamma: the sum of n independent exponential(λ) variables is a gamma(n, λ), with density λnΓ(n)sn−1e−λs \frac{\lambda^n}{\Gamma(n)} s^{n-1} e^{-\lambda s} , and ∫0∞sa−1e−λs ds=Γ(a)λa \int_0^\infty s^{a-1} e^{-\lambda s}\,ds = \frac{\Gamma(a)}{\lambda^a} . Also Γ(a)=(a−1) Γ(a−1) \Gamma(a) = (a-1)\,\Gamma(a-1) .
  8. Consistency theorem: if E(θ^n)→θ E(\hat\theta_n) \to \theta and Var(θ^n)→0 \text{Var}(\hat\theta_n) \to 0 , then θ^n \hat\theta_n is consistent.

Proof 1: S² is unbiased and S’² is not (though it is asymptotically unbiased)

What we want to prove

In any population with mean μ and variance σ² (it does not have to be normal):

E(S2)=σ2,E(S′2)=n−1nσ2,b(S′2)=−σ2n→n→∞0 E(S^2) = \sigma^2, \qquad E(S'^2) = \frac{n-1}{n}\sigma^2, \qquad b(S'^2) = -\frac{\sigma^2}{n} \xrightarrow[n\to\infty]{} 0

Why it matters. It is the reason R’s var() and sd() divide by n − 1, and why “an unbiased estimator of σ²” is S2 S^2 and not S′2 S'^2 . And the technique (open up the square and use rule 3) comes back all through the topic.

Where we start

A simple random sample X1,…,Xn X_1, \dots, X_n with E(Xi)=μ E(X_i) = \mu and Var(Xi)=σ2 \text{Var}(X_i) = \sigma^2 , and the two definitions:

S2=1n−1∑i=1n(Xi−Xˉ)2,S′2=1n∑i=1n(Xi−Xˉ)2 S^2 = \frac{1}{n-1}\sum_{i=1}^n (X_i – \bar X)^2, \qquad S'^2 = \frac1n \sum_{i=1}^n (X_i – \bar X)^2

Both share the sum of squares SS=∑(Xi−Xˉ)2 SS = \sum (X_i – \bar X)^2 . It is enough to compute E(SS) E(SS) .

Step 1: open up the sum of squares

Expanding the square, (Xi−Xˉ)2=Xi2−2XiXˉ+Xˉ2 (X_i – \bar X)^2 = X_i^2 – 2X_i\bar X + \bar X^2 . Summing over i, and since ∑Xi=nXˉ \sum X_i = n\bar X :

SS=∑Xi2−2Xˉ∑Xi+nXˉ2=∑Xi2−2nXˉ2+nXˉ2=∑Xi2−nXˉ2 SS = \sum X_i^2 – 2\bar X \sum X_i + n\bar X^2 = \sum X_i^2 – 2n\bar X^2 + n\bar X^2 = \sum X_i^2 – n\bar X^2

Why Xˉ \bar X comes out of the sum: it does not depend on i, it is the same number in all n terms. And Xˉ2 \bar X^2 added n times gives nXˉ2 n\bar X^2 .

Step 2: the expectation of each piece

By rule 1, E(SS)=∑E(Xi2)−n E(Xˉ2) E(SS) = \sum E(X_i^2) – n\,E(\bar X^2) . Each piece comes from rule 3:

E(Xi2)=Var(Xi)+E(Xi)2=σ2+μ2 E(X_i^2) = \text{Var}(X_i) + E(X_i)^2 = \sigma^2 + \mu^2
E(Xˉ2)=Var(Xˉ)+E(Xˉ)2=σ2n+μ2 E(\bar X^2) = \text{Var}(\bar X) + E(\bar X)^2 = \frac{\sigma^2}{n} + \mu^2

where Var(Xˉ)=σ2/n \text{Var}(\bar X) = \sigma^2/n is rule 2.

And E(Xˉ)=μ E(\bar X) = \mu by rule 1. Notice that E(Xˉ2) E(\bar X^2) overshoots μ2 \mu^2 by exactly σ2/n \sigma^2/n : that piece is what ends up producing the n − 1.

Step 3: put it together

E(SS)=n(σ2+μ2)−n(σ2n+μ2)=nσ2+nμ2−σ2−nμ2=(n−1)σ2 E(SS) = n(\sigma^2 + \mu^2) – n\left(\frac{\sigma^2}{n} + \mu^2\right) = n\sigma^2 + n\mu^2 – \sigma^2 – n\mu^2 = (n-1)\sigma^2

The μ2 \mu^2 terms cancel. That is why the result holds for any mean.

Step 4: divide

E(S2)=E(SS)n−1=σ2⇒S2 is unbiased E(S^2) = \frac{E(SS)}{n-1} = \sigma^2 \qquad\Rightarrow\qquad S^2 \text{ is unbiased}
E(S′2)=E(SS)n=n−1nσ2,b(S′2)=n−1nσ2−σ2=−σ2n E(S'^2) = \frac{E(SS)}{n} = \frac{n-1}{n}\sigma^2, \qquad b(S'^2) = \frac{n-1}{n}\sigma^2 – \sigma^2 = -\frac{\sigma^2}{n}

And since n−1n→1 \frac{n-1}{n} \to 1 , E(S′2)→σ2 E(S'^2) \to \sigma^2 : S′2 S'^2 is asymptotically unbiased.

Writing E(Xˉ2)=μ2 E(\bar X^2) = \mu^2 . The mean of a square is not the square of the mean: the variance, σ2/n \sigma^2/n , is missing. If you drop it, you get E(SS)=nσ2 E(SS) = n\sigma^2 and conclude that S′2 S'^2 is unbiased, exactly the wrong way round.

Where does that n − 1 really come from? Xˉ \bar X is computed from the same data, and it is the point that makes the sum of squares smallest (we saw it in descriptive statistics). Measuring the distances to Xˉ \bar X instead of μ always gives something smaller, and dividing by n − 1 makes up for exactly that loss.

Result for the cheat sheet: E(S2)=σ2 E(S^2) = \sigma^2 ; E(S′2)=n−1nσ2 E(S'^2) = \frac{n-1}{n}\sigma^2 ; b(S′2)=−σ2/n b(S'^2) = -\sigma^2/n .

Check it with R

With the trip distance, N(2.4, 0.7), and also with a population that is not normal (duration, exponential with mean 12 minutes, σ² = 144), with samples of 5:

set.seed(1)
ss_norm <- replicate(20000, { x <- rnorm(15, 2.4, 0.7); sum((x - mean(x))^2) })
ss_exp  <- replicate(20000, { x <- rexp(5, 1 / 12);    sum((x - mean(x))^2) })
round(c(S2_norm = mean(ss_norm / 14), S2prime_norm = mean(ss_norm / 15), theo_prime_norm = 14 / 15 * 0.49,
        S2_exp  = mean(ss_exp / 4),   S2prime_exp  = mean(ss_exp / 5),   theo_prime_exp  = 4 / 5 * 144), 3)

Output:

        S2_norm    S2prime_norm theo_prime_norm          S2_exp 
          0.491           0.458           0.457         143.727 
    S2prime_exp  theo_prime_exp 
        114.982         115.200 

In the normal, S2 S^2 gives 0.491 (σ² = 0.49) and S′2 S'^2 gives 0.458, next to the formula 1415⋅0.49=0.457 \frac{14}{15} \cdot 0.49 = 0.457 . In the exponential the same happens, with a much more visible bias because n = 5: S2 S^2 gives 143.7 (σ² = 144) and S′2 S'^2 stays at 115, four fifths of 144.

Check you’ve got it: if you knew μ and measured the distances to μ instead of to the sample mean, would you have to divide by n − 1?

No, by n. Each (Xi−μ)2 (X_i – \mu)^2 has expectation σ2 \sigma^2 (that is the definition of variance), so the sum has expectation nσ2 n\sigma^2 by rule 1. The n − 1 only appears when μ is replaced by Xˉ \bar X , which is computed from the same data and sticks to them: on average the sum loses one σ², the n Var(Xˉ) n\,\text{Var}(\bar X) from step 2.

Proof 2: MSE equals variance plus squared bias

What we want to prove

E[(θ^−θ)2]=Var(θ^)+b(θ^)2 E\left[(\hat\theta – \theta)^2\right] = \text{Var}(\hat\theta) + b(\hat\theta)^2

Why it matters. It is the tool used to compare every estimator in the topic: the MSE comes from the variance and the bias, which you already know how to compute, without integrating (θ^−θ)2 (\hat\theta – \theta)^2 . Proofs 4 and 5 use it.

Where we start

The definition of the MSE and that of the bias, b(θ^)=E(θ^)−θ b(\hat\theta) = E(\hat\theta) – \theta . To write less, I call m=E(θ^) m = E(\hat\theta) , which is a number, not a random variable.

Step 1: add and subtract the mean

θ^−θ=(θ^−m)+(m−θ) \hat\theta – \theta = (\hat\theta – m) + (m – \theta)

I have not changed anything (−m+m=0 -m + m = 0 ), but I have split the error in two: how far the estimator strays from its own center and how far that center is from θ.

Why m and not some other number? Because it is the only one that makes the cross term vanish in step 4: how far the estimator strays from its own mean is 0 on average.

Step 2: square it

(θ^−θ)2=(θ^−m)2+2(θ^−m)(m−θ)+(m−θ)2 (\hat\theta – \theta)^2 = (\hat\theta – m)^2 + 2(\hat\theta – m)(m – \theta) + (m – \theta)^2

It is (a+b)2=a2+2ab+b2 (a + b)^2 = a^2 + 2ab + b^2 , with a=θ^−m a = \hat\theta – m (the random part) and b=m−θ b = m – \theta (a fixed number).

Step 3: take expectations

By rule 1, the expectation of the sum is the sum of the expectations. In the middle term, 2(m−θ) 2(m – \theta) is a number and comes outside:

E[(θ^−θ)2]=E[(θ^−m)2]+2(m−θ) E(θ^−m)+(m−θ)2 E\left[(\hat\theta – \theta)^2\right] = E\left[(\hat\theta – m)^2\right] + 2(m – \theta)\,E(\hat\theta – m) + (m – \theta)^2

Step 4: the cross term is 0

E(θ^−m)=E(θ^)−m=m−m=0 E(\hat\theta – m) = E(\hat\theta) – m = m – m = 0 . What is left:

E[(θ^−θ)2]=E[(θ^−m)2]+(m−θ)2=Var(θ^)+b(θ^)2 E\left[(\hat\theta – \theta)^2\right] = E\left[(\hat\theta – m)^2\right] + (m – \theta)^2 = \text{Var}(\hat\theta) + b(\hat\theta)^2

The first piece is the definition of variance (the mean of the squares of how far it strays from its mean) and the second, the squared bias.

MSE as the square of a hypotenuseA right triangle. One leg is the standard deviation of the fleet maximum, 171; the other, the absolute value of its bias, 185. The hypotenuse is the square root of the MSE, 252. On the right, the numbers: variance 29,296, squared bias 34,391 and MSE 63,687.|bias| = 185std. dev. = 171√MSE = 252The maximum, n = 12Var = 29,296b² = 34,391MSE = 63,687
MSE = Var + b²: the hypotenuse is never shorter than a leg.

In the picture, the MSE is like the square of a hypotenuse: the legs are the standard deviation of the estimator and its bias. That is why the MSE is never smaller than the variance (as in my story) and why a small bias hardly counts: it enters squared.

Forgetting to square the bias. With a negative bias, Var+b \text{Var} + b gives a number smaller than the variance, which is impossible. If that happens, check the square.

Result for the cheat sheet: MSE(θ^)=Var(θ^)+b(θ^)2 \text{MSE}(\hat\theta) = \text{Var}(\hat\theta) + b(\hat\theta)^2 ; if it is unbiased, MSE=Var \text{MSE} = \text{Var} .

Check it with R

The identity is exact with the numbers of a simulation too, if the variance is computed dividing by the number of simulations (not with var(), which divides by B − 1):

set.seed(2)
m <- replicate(10000, max(runif(12, 0, 2400)))      # 10,000 maxima of 12 serial numbers
c(mse = mean((m - 2400)^2),
  var_plus_bias2 = mean((m - mean(m))^2) + (mean(m) - 2400)^2)

Output:

           mse var_plus_bias2 
       60426.9        60426.9 

Identical to the last decimal: it is algebra, not an approximation.

Check you’ve got it: an estimator has variance 9 and bias −2. What is its MSE? Could it come out as 7?

13: 9+(−2)2=9+4 9 + (-2)^2 = 9 + 4 . The 7 is what you get with the mistake from my story, Var+b=9−2 \text{Var} + b = 9 – 2 , and it is impossible: the MSE never drops below the variance. With bias +2 you would also get 13: the sign does not count, because it enters squared.

Proof 3: the maximum of the uniform, its density, mean and variance

What we want to prove

If X1,…,Xn X_1, \dots, X_n is a simple random sample from a uniform(0, θ) and X(n)=max⁡(Xi) X_{(n)} = \max(X_i) :

fX(n)(x)=n xn−1θn, 0≤x≤θ;E(X(n))=nn+1θ;Var(X(n))=n θ2(n+1)2(n+2) f_{X_{(n)}}(x) = \frac{n\,x^{n-1}}{\theta^n},\ 0 \le x \le \theta; \qquad E(X_{(n)}) = \frac{n}{n+1}\theta; \qquad \text{Var}(X_{(n)}) = \frac{n\,\theta^2}{(n+1)^2(n+2)}

Why it matters. The maximum is the MLE of θ in the uniform, but it is not a sum, so rules 1 and 2 do not help. Without its mean and variance there is no MSE of the maximum and no proof 4. And the trick of going through the distribution function works for any maximum or minimum.

Where we start

Each Xi X_i has distribution function F(x)=x/θ F(x) = x/\theta on [0,θ] [0, \theta] . The maximum has no direct formula, but it has an easy question: when is the maximum less than x?

Step 1: the distribution function of the maximum

The maximum of the twelve numbers is at most x if and only if all of them are at most x. By rule 4:

FX(n)(x)=P(X(n)≤x)=P(X1≤x,…,Xn≤x)=(xθ)n,0≤x≤θ F_{X_{(n)}}(x) = P(X_{(n)} \le x) = P(X_1 \le x, \dots, X_n \le x) = \left(\frac{x}{\theta}\right)^n, \quad 0 \le x \le \theta
Why the distribution of the maximum is (x/θ) to the nOn the left, a line from 0 to theta with a point x and twelve points, all in the shaded zone from 0 to x: for the maximum to stay below x they all have to land there, each with probability x over theta, so P is x over theta to the n. On the right, the density of the maximum with n equal to 12 and theta 2400: almost zero up to 1200 and rising very fast up to 2400, with the mean at 2215.0θxAll of them below x:P = (x/θ)·(x/θ)···(x/θ) = (x/θ)ⁿ0.00000.00250.005001,2002,400Density of the maximum, n = 12E = 2215
All below x, each with probability x/θ: (x/θ)ⁿ, and its derivative, n xⁿ⁻¹/θⁿ.

In the picture, on the left, for the maximum to stay below x all twelve scooters have to land in the shaded zone, and each does so with probability x/θ. On the right, the density that comes out: almost all its mass is pressed against θ.

Why multiply: each Xi X_i falls below x with probability x/θ x/\theta , and by rule 4 the probability that all n do at once is the product of n equal factors.

Step 2: differentiate

fX(n)(x)=ddx(xθ)n=n xn−1θn,0≤x≤θ f_{X_{(n)}}(x) = \frac{d}{dx}\left(\frac{x}{\theta}\right)^n = \frac{n\,x^{n-1}}{\theta^n}, \quad 0 \le x \le \theta

It is the chain rule: bring down the n, subtract one from the exponent and multiply by the derivative of the inside, 1/θ 1/\theta : n(x/θ)n−1⋅1θ=n xn−1θn n(x/\theta)^{n-1}\cdot\frac1\theta = \frac{n\,x^{n-1}}{\theta^n} .

Step 3: the mean

By rule 5:

E(X(n))=∫0θx⋅n xn−1θn dx=nθn∫0θxn dx=nθn⋅θn+1n+1=nn+1θ E(X_{(n)}) = \int_0^\theta x \cdot \frac{n\,x^{n-1}}{\theta^n}\,dx = \frac{n}{\theta^n}\int_0^\theta x^n\,dx = \frac{n}{\theta^n}\cdot\frac{\theta^{n+1}}{n+1} = \frac{n}{n+1}\theta

What gets skipped: nθn \frac{n}{\theta^n} comes out of the integral because it does not depend on x; x⋅xn−1=xn x\cdot x^{n-1} = x^n , whose antiderivative is xn+1n+1 \frac{x^{n+1}}{n+1} ; and θn+1/θn=θ \theta^{n+1}/\theta^n = \theta .

Step 4: the second moment

E(X(n)2)=nθn∫0θxn+1 dx=nθn⋅θn+2n+2=nn+2θ2 E(X_{(n)}^2) = \frac{n}{\theta^n}\int_0^\theta x^{n+1}\,dx = \frac{n}{\theta^n}\cdot\frac{\theta^{n+2}}{n+2} = \frac{n}{n+2}\theta^2

Step 5: the variance

By rule 3, over a common denominator:

Var(X(n))=nn+2θ2−n2(n+1)2θ2=nθ2 (n+1)2−n(n+2)(n+1)2(n+2) \text{Var}(X_{(n)}) = \frac{n}{n+2}\theta^2 – \frac{n^2}{(n+1)^2}\theta^2 = n\theta^2\,\frac{(n+1)^2 – n(n+2)}{(n+1)^2(n+2)}

In the numerator, (n+1)2−n(n+2)=n2+2n+1−n2−2n=1 (n+1)^2 – n(n+2) = n^2 + 2n + 1 – n^2 – 2n = 1 . So

Var(X(n))=n θ2(n+1)2(n+2) \text{Var}(X_{(n)}) = \frac{n\,\theta^2}{(n+1)^2(n+2)}

Writing P(X(n)≤x)=1−(1−x/θ)n P(X_{(n)} \le x) = 1 – (1 – x/\theta)^n . That is the minimum‘s, the other way round: for the minimum, “the minimum is greater than x” if all of them are greater than x. For the maximum, all of them smaller. If in doubt, try x = θ: the maximum’s must equal 1.

Result for the cheat sheet: FX(n)(x)=(x/θ)n F_{X_{(n)}}(x) = (x/\theta)^n ; f(x)=nxn−1/θn f(x) = n x^{n-1}/\theta^n ; E=nn+1θ E = \frac{n}{n+1}\theta ; E(X(n)2)=nn+2θ2 E(X_{(n)}^2) = \frac{n}{n+2}\theta^2 ; Var=nθ2(n+1)2(n+2) \text{Var} = \frac{n\theta^2}{(n+1)^2(n+2)} .

Check it with R

With the fleet of 2400 and n = 12, integrating the density:

n <- 12; theta <- 2400
dmax <- function(x) n * x^(n - 1) / theta^n
c(area     = integrate(dmax, 0, theta)$value,
  mean     = integrate(function(x) x * dmax(x), 0, theta)$value,
  theo_mean = n / (n + 1) * theta,
  var      = integrate(function(x) x^2 * dmax(x), 0, theta)$value - (n / (n + 1) * theta)^2,
  theo_var = n * theta^2 / ((n + 1)^2 * (n + 2)))

Output:

     area      mean theo_mean       var  theo_var 
    1.000  2215.385  2215.385 29213.863 29213.863 

The density integrates to 1, and the mean (2215.385) and variance (29,214) match the formulas: the maximum of 12 serial numbers falls, on average, 184.62 scooters short of the end of the fleet.

Check you’ve got it: with n = 1, what do the formulas for the mean and the variance of the maximum give? Does it make sense?

E=12θ E = \frac12\theta and Var=θ24⋅3=θ212 \text{Var} = \frac{\theta^2}{4\cdot 3} = \frac{\theta^2}{12} : the mean and the variance of the uniform(0, θ). It has to be so, because the maximum of a single number is that number. Trying n = 1 is a quick way to check in the exam that you have written the formula correctly.

Proof 4: the three fleet estimators compared by MSE

What we want to prove

For the uniform(0, θ), with θ~=2Xˉ \tilde\theta = 2\bar X , θ^=X(n) \hat\theta = X_{(n)} and θ^c=n+1nX(n) \hat\theta_c = \frac{n+1}{n}X_{(n)} :

  1. MSE(θ~)=θ23n \text{MSE}(\tilde\theta) = \frac{\theta^2}{3n} , MSE(θ^)=2θ2(n+1)(n+2) \text{MSE}(\hat\theta) = \frac{2\theta^2}{(n+1)(n+2)} and MSE(θ^c)=θ2n(n+2) \text{MSE}(\hat\theta_c) = \frac{\theta^2}{n(n+2)} .
  2. For n ≥ 2, θ^c \hat\theta_c has the smallest MSE.
  3. All three are consistent.

Why it matters. It answers the fleet question: with 12 serial numbers, which estimator should I use? And it shows that being unbiased is not enough: 2Xˉ 2\bar X is unbiased too and loses by a long way. What decides is the MSE.

Where we start

The uniform(0, θ) has mean θ/2 and variance θ²/12. For the maximum, proof 3. And proof 2.

Step 1: the moments estimator

By rules 1 and 2: E(2Xˉ)=2⋅θ2=θ E(2\bar X) = 2 \cdot \frac\theta2 = \theta (unbiased) and

Var(2Xˉ)=4 Var(Xˉ)=4⋅θ2/12n=θ23n=MSE(2Xˉ) \text{Var}(2\bar X) = 4\,\text{Var}(\bar X) = 4 \cdot \frac{\theta^2/12}{n} = \frac{\theta^2}{3n} = \text{MSE}(2\bar X)

Why the 4: rule 2 takes the constant out squared, and Var(Xˉ) \text{Var}(\bar X) is rule 2 with σ2=θ2/12 \sigma^2 = \theta^2/12 . MSE = Var because it is unbiased (b = 0 in proof 2).

Step 2: the maximum

Its bias is b=nn+1θ−θ=−θn+1 b = \frac{n}{n+1}\theta – \theta = -\frac{\theta}{n+1} . By proof 2:

MSE(X(n))=nθ2(n+1)2(n+2)+θ2(n+1)2=θ2 n+(n+2)(n+1)2(n+2)=θ2 2(n+1)(n+1)2(n+2)=2θ2(n+1)(n+2) \text{MSE}(X_{(n)}) = \frac{n\theta^2}{(n+1)^2(n+2)} + \frac{\theta^2}{(n+1)^2} = \theta^2\,\frac{n + (n+2)}{(n+1)^2(n+2)} = \theta^2\,\frac{2(n+1)}{(n+1)^2(n+2)} = \frac{2\theta^2}{(n+1)(n+2)}

What gets skipped: the second term is multiplied top and bottom by (n + 2); on top you get n + n + 2 = 2(n + 1), which cancels with one (n + 1) underneath.

Step 3: the corrected maximum

It is unbiased: E(θ^c)=n+1n⋅nn+1θ=θ E(\hat\theta_c) = \frac{n+1}{n}\cdot\frac{n}{n+1}\theta = \theta . By rule 2, the constant comes out squared:

MSE(θ^c)=Var(θ^c)=(n+1)2n2⋅nθ2(n+1)2(n+2)=θ2n(n+2) \text{MSE}(\hat\theta_c) = \text{Var}(\hat\theta_c) = \frac{(n+1)^2}{n^2}\cdot\frac{n\theta^2}{(n+1)^2(n+2)} = \frac{\theta^2}{n(n+2)}

The constant n+1n \frac{n+1}{n} comes out squared; the (n+1)2 (n+1)^2 cancel, and n/n2 n/n^2 leaves 1/n 1/n .

Step 4: the ratios

The θ² cancel:

MSE(2Xˉ)MSE(θ^c)=θ2/(3n)θ2/(n(n+2))=n+23,MSE(X(n))MSE(θ^c)=2θ2/((n+1)(n+2))θ2/(n(n+2))=2nn+1 \frac{\text{MSE}(2\bar X)}{\text{MSE}(\hat\theta_c)} = \frac{\theta^2/(3n)}{\theta^2/(n(n+2))} = \frac{n+2}{3}, \qquad \frac{\text{MSE}(X_{(n)})}{\text{MSE}(\hat\theta_c)} = \frac{2\theta^2/((n+1)(n+2))}{\theta^2/(n(n+2))} = \frac{2n}{n+1}

Both equal 1 when n = 1 (with a single scooter, 2X1=θ^c 2X_1 = \hat\theta_c and they coincide) and are greater than 1 for n ≥ 2: n+23>1  ⟺  n>1 \frac{n+2}{3} > 1 \iff n > 1 and 2nn+1>1  ⟺  n>1 \frac{2n}{n+1} > 1 \iff n > 1 . The corrected maximum is the best of the three. With n = 12, the ratios are 14/3 = 4.67 and 24/13 = 1.85.

The MSE of the three fleet estimators as n growsThree curves of the MSE divided by theta squared, for n from 1 to 200, with both axes on a log scale. All three start together at n equal to 1 (one third). The 2X̄ one falls as a line of slope minus 1; the maximum and corrected maximum fall with slope minus 2, and the corrected one always stays below. A dashed line marks n equal to 12.10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹1n (log scale)MSE / θ²12512502002X̄maximumcorrected
The moments one falls like 1/n; the two maximum ones like 1/n²: the gap grows with n.

In the picture, the MSE of each estimator (divided by θ²) as n grows, on a log scale. The two maximum lines fall with twice the slope of 2X̄’s: their MSE goes like 1/n2 1/n^2 , and the moments one like 1/n 1/n .

Step 5: consistency by the theorem

All three are (asymptotically) unbiased: E(2Xˉ)=E(θ^c)=θ E(2\bar X) = E(\hat\theta_c) = \theta and E(X(n))=nn+1θ→θ E(X_{(n)}) = \frac{n}{n+1}\theta \to \theta . And their variances have n in the denominator: θ23n→0 \frac{\theta^2}{3n} \to 0 , nθ2(n+1)2(n+2)→0 \frac{n\theta^2}{(n+1)^2(n+2)} \to 0 (degree 1 on top, degree 3 below) and θ2n(n+2)→0 \frac{\theta^2}{n(n+2)} \to 0 . By rule 8, all three are consistent.

Step 6: the maximum, also by the definition

With the maximum you can go straight to the definition. Since X(n)≤θ X_{(n)} \le \theta always, being more than ε away can only happen from below:

P(∣X(n)−θ∣>ε)=P(X(n)<θ−ε)=(θ−εθ)n=(1−εθ)n→n→∞0 P\left(|X_{(n)} – \theta| > \varepsilon\right) = P(X_{(n)} < \theta – \varepsilon) = \left(\frac{\theta – \varepsilon}{\theta}\right)^n = \left(1 – \frac\varepsilon\theta\right)^n \xrightarrow[n\to\infty]{} 0

because 0<1−ε/θ<1 0 < 1 – \varepsilon/\theta < 1 . With ε = 100 scooters and θ = 2400, the base is 23/24 23/24 : with 12 scooters, (23/24)12=0.60 (23/24)^{12} = 0.60 , and with 200, 0.0002 0.0002 . Those are exactly the “outside” proportions of the theory simulation (1 − 0.41 and 1 − 1.000).

Saying the maximum “is not consistent because it is biased”. Consistency asks for a bias that vanishes, not zero bias: the maximum is asymptotically unbiased and its variance goes to 0.

Result for the cheat sheet: uniform(0, θ): MSE(2Xˉ)=θ23n \text{MSE}(2\bar X) = \frac{\theta^2}{3n} ; MSE(X(n))=2θ2(n+1)(n+2) \text{MSE}(X_{(n)}) = \frac{2\theta^2}{(n+1)(n+2)} ; MSE(n+1nX(n))=θ2n(n+2) \text{MSE}\left(\frac{n+1}{n}X_{(n)}\right) = \frac{\theta^2}{n(n+2)} .

Check it with R

The ratios for several n, with the formulas, and the probability of being more than 100 scooters off:

n <- c(1, 2, 5, 12, 50, 200)
data.frame(n,
           mom_over_cor = round((n + 2) / 3, 2),
           max_over_cor = round(2 * n / (n + 1), 2),
           P_out_max    = signif((23 / 24)^n, 3))

Output:

    n mom_over_cor max_over_cor P_out_max
1   1         1.00         1.00  0.958000
2   2         1.33         1.33  0.918000
3   5         2.33         1.67  0.808000
4  12         4.67         1.85  0.600000
5  50        17.33         1.96  0.119000
6 200        67.33         1.99  0.000201

With n = 1 all three tie; from n = 2 on, the corrected one always wins. The last column is (1−100/2400)n (1 – 100/2400)^n , which goes to 0.

Check you’ve got it: with 12 serial numbers and θ = 2400, what is the square root of the MSE of each estimator? What does it mean in scooters?

2Xˉ 2\bar X : 2400/36=400 2400/\sqrt{36} = 400 . Maximum: 2⋅24002/(13⋅14)=251.59 \sqrt{2\cdot 2400^2/(13\cdot 14)} = 251.59 . Corrected: 24002/(12⋅14)=185.16 \sqrt{2400^2/(12\cdot 14)} = 185.16 . It is in the same units as θ: it is the typical error, in scooters. With 2Xˉ 2\bar X you are off by about 400; with the corrected one, by about 185.

Proof 5: S² versus S’² in the normal

What we want to prove

In a normal population:

MSE(S2)=2σ4n−1,MSE(S′2)=(2n−1) σ4n2,MSE(S′2)<MSE(S2) \text{MSE}(S^2) = \frac{2\sigma^4}{n-1}, \qquad \text{MSE}(S'^2) = \frac{(2n-1)\,\sigma^4}{n^2}, \qquad \text{MSE}(S'^2) < \text{MSE}(S^2)

Why it matters. It is the classic counterexample: the unbiased estimator is not the one with the smallest MSE. It comes up as “compare S2 S^2 and S′2 S'^2 by their MSE” and explains the 0.0343 against 0.0309 of the theory simulation. For the variances you do need the population to be normal.

Where we start

Rule 6: W=(n−1)S2σ2∼χn−12 W = \frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1} , with Var(W)=2(n−1) \text{Var}(W) = 2(n-1) . And proof 1 for the biases.

Step 1: the variance of S²

Solving for it, S2=σ2n−1W S^2 = \frac{\sigma^2}{n-1}W . By rule 2:

Var(S2)=σ4(n−1)2 Var(W)=σ4(n−1)2⋅2(n−1)=2σ4n−1 \text{Var}(S^2) = \frac{\sigma^4}{(n-1)^2}\,\text{Var}(W) = \frac{\sigma^4}{(n-1)^2}\cdot 2(n-1) = \frac{2\sigma^4}{n-1}

Since S2 S^2 is unbiased, that is its MSE.

Why σ4 \sigma^4 : the constant σ2n−1 \frac{\sigma^2}{n-1} comes out squared (rule 2). And the χn−12 \chi^2_{n-1} has variance 2(n − 1) (rule 6), which takes away one of the (n − 1) underneath.

Step 2: the MSE of S’²

S′2=n−1nS2 S'^2 = \frac{n-1}{n}S^2 , so Var(S′2)=(n−1)2n2⋅2σ4n−1=2(n−1)σ4n2 \text{Var}(S'^2) = \frac{(n-1)^2}{n^2}\cdot\frac{2\sigma^4}{n-1} = \frac{2(n-1)\sigma^4}{n^2} , and its bias is −σ2/n -\sigma^2/n (proof 1). By proof 2:

MSE(S′2)=2(n−1)σ4n2+σ4n2=(2n−1) σ4n2 \text{MSE}(S'^2) = \frac{2(n-1)\sigma^4}{n^2} + \frac{\sigma^4}{n^2} = \frac{(2n-1)\,\sigma^4}{n^2}

What gets skipped: the squared bias is σ4/n2 \sigma^4/n^2 , and with the same denominator 2(n−1)+1=2n−1 2(n-1) + 1 = 2n – 1 .

Step 3: compare

2n−1n2<2n−1  ⟺  (2n−1)(n−1)<2n2  ⟺  2n2−3n+1<2n2  ⟺  1<3n \frac{2n-1}{n^2} < \frac{2}{n-1} \iff (2n-1)(n-1) < 2n^2 \iff 2n^2 – 3n + 1 < 2n^2 \iff 1 < 3n

which holds for every n ≥ 2. The biased estimator has the smaller MSE. What it loses through the bias it more than wins back in variance: multiplying by n−1n<1 \frac{n-1}{n} < 1 shrinks the variance.

Why you can multiply across in step 3: n2(n−1) n^2(n-1) is positive (n ≥ 2 for S2 S^2 to exist), so the inequality does not flip.

Step 4 (for the curious): the best divisor

What if we divide the sum of squares by some other number k? With Tk=SS/k T_k = SS/k and SS=σ2W SS = \sigma^2 W :

E(Tk)=(n−1)σ2k,Var(Tk)=2(n−1)σ4k2,MSE(Tk)σ4=2(n−1)+(n−1−k)2k2 E(T_k) = \frac{(n-1)\sigma^2}{k}, \qquad \text{Var}(T_k) = \frac{2(n-1)\sigma^4}{k^2}, \qquad \frac{\text{MSE}(T_k)}{\sigma^4} = \frac{2(n-1) + (n-1-k)^2}{k^2}

Calling m = n − 1, the derivative with respect to k vanishes when −(m−k)k−(2m+(m−k)2)=0 -(m-k)k – (2m + (m-k)^2) = 0 , which simplifies to mk−2m−m2=0 mk – 2m – m^2 = 0 , that is, k=m+2=n+1 k = m + 2 = n + 1 . The smallest MSE comes from dividing by n + 1, and it is 2σ4n+1 \frac{2\sigma^4}{n+1} .

The MSE of the sum of squares divided by kA curve of the MSE, divided by sigma to the fourth, of the sum of squares divided by k, for k from 8 to 30 with n equal to 15. It is U-shaped with its minimum at k equal to 16. Marked: k equal to 14, the sample variance S², to the left and higher; k equal to 15, the variance S prime squared, lower; and k equal to 16, the minimum.0.1000.1250.1500.1750.200810141516202530divisor k of the sum of squaresMSE / σ⁴S²S'²minimumn = 15
Dividing by n − 1 removes the bias; dividing by n + 1 gives the smallest MSE.

In the picture, the MSE of SS/k SS/k with n = 15 as a function of the divisor k: n − 1 = 14 (the sample variance S²) is to the left of the minimum, n = 15 closer, and the minimum is at 16.

Result for the cheat sheet: normal: Var(S2)=2σ4n−1 \text{Var}(S^2) = \frac{2\sigma^4}{n-1} ; MSE(S′2)=(2n−1)σ4n2 \text{MSE}(S'^2) = \frac{(2n-1)\sigma^4}{n^2} (smaller than that of S2 S^2 ).

Check it with R

The formulas with σ = 0.7 (σ⁴ = 0.2401) for several n, and the divisor that minimises the MSE, found with optimize:

s4 <- 0.7^4
n  <- c(2, 5, 15, 50)
data.frame(n, mse_S2 = round(2 * s4 / (n - 1), 4), mse_S2prime = round((2 * n - 1) * s4 / n^2, 4))
mse_k <- function(k, n = 15) (2 * (n - 1) + (n - 1 - k)^2) / k^2
round(optimize(mse_k, c(5, 40))$minimum, 2)

Output:

   n mse_S2 mse_S2prime
1  2 0.4802      0.1801
2  5 0.1200      0.0864
3 15 0.0343      0.0309
4 50 0.0098      0.0095
[1] 16

With n = 15, 0.0343 against 0.0309, the two numbers the theory simulation gave. And optimize finds the minimum at k = 16 = n + 1.

Check you’ve got it: with n = 15 and σ = 0.7, what is the MSE when dividing by n + 1 = 16? Compare it with those of S² and S’².

2⋅0.240116=0.0300 \frac{2\cdot 0.2401}{16} = 0.0300 , against 0.0309 for S′2 S'^2 and 0.0343 for S2 S^2 : the closer the divisor is to 16, the smaller the MSE, as in the picture. The gain from 15 to 16 is so small (0.0009) that nobody divides by n + 1: you use S2 S^2 because it is unbiased or S′2 S'^2 because it is the MLE.

Proof 6: X̄ is efficient in the Poisson and the normal

What we want to prove

  1. In a Poisson(λ), i(λ)=1/λ i(\lambda) = 1/\lambda , the Cramér–Rao bound is λ/n and Xˉ \bar X is efficient for λ.
  2. In a N(μ,σ) N(\mu, \sigma) with σ known, i(μ)=1/σ2 i(\mu) = 1/\sigma^2 , the bound is σ²/n and Xˉ \bar X is efficient for μ.

Why it matters. The bound is a floor: no unbiased estimator has a smaller variance, so if one touches it, there is nothing better to look for. And the four-step plan works as it is for any other model in the exam.

Where we start

The bound for an unbiased estimator with a simple random sample of size n:

Var(θ^)≥1n i(θ),i(θ)=−E[∂2log⁡f(X∣θ)∂θ2] \text{Var}(\hat\theta) \ge \frac{1}{n\,i(\theta)}, \qquad i(\theta) = -E\left[\frac{\partial^2 \log f(X\mid\theta)}{\partial\theta^2}\right]

The plan is always the same, in four steps: the log of f for one observation, differentiate twice with respect to the parameter, the expectation with the sign changed, and divide.

Step 1: the Poisson, logarithm

f(x∣λ)=e−λλxx!⇒log⁡f(x∣λ)=−λ+xlog⁡λ−log⁡(x!) f(x\mid\lambda) = \frac{e^{-\lambda}\lambda^x}{x!} \quad\Rightarrow\quad \log f(x\mid\lambda) = -\lambda + x\log\lambda – \log(x!)

The logarithm turns products and powers into sums: log⁡e−λ=−λ \log e^{-\lambda} = -\lambda , log⁡λx=xlog⁡λ \log\lambda^x = x\log\lambda , and x! x! moves over as a subtraction.

Step 2: differentiate twice with respect to λ

log⁡(x!) \log(x!) does not depend on λ and disappears:

∂log⁡f∂λ=−1+xλ,∂2log⁡f∂λ2=−xλ2 \frac{\partial \log f}{\partial\lambda} = -1 + \frac{x}{\lambda}, \qquad \frac{\partial^2 \log f}{\partial\lambda^2} = -\frac{x}{\lambda^2}

When differentiating with respect to λ, x is a constant: xlog⁡λ x\log\lambda gives x/λ x/\lambda , and the second time xλ−1 x\lambda^{-1} gives −xλ−2 -x\lambda^{-2} .

Step 3: the information

Replacing x with X and taking expectations (rule 1; λ is a number):

i(λ)=−E[−Xλ2]=E(X)λ2=λλ2=1λ i(\lambda) = -E\left[-\frac{X}{\lambda^2}\right] = \frac{E(X)}{\lambda^2} = \frac{\lambda}{\lambda^2} = \frac{1}{\lambda}

What is used: in a Poisson, E(X)=λ E(X) = \lambda . The minus sign in the definition is there so that the information comes out positive: the second derivative is negative.

Step 4: the bound and the variance

bound=1n⋅1λ=λn,Var(Xˉ)=Var(X)n=λn \text{bound} = \frac{1}{n\cdot\frac1\lambda} = \frac\lambda n, \qquad \text{Var}(\bar X) = \frac{\text{Var}(X)}{n} = \frac{\lambda}{n}

And Xˉ \bar X is unbiased (E(Xˉ)=λ E(\bar X) = \lambda ). Variance equal to the bound: Xˉ \bar X is efficient for λ.

Step 5: the normal, the same way

log⁡f(x∣μ)=−log⁡σ−12log⁡(2π)−(x−μ)22σ2 \log f(x\mid\mu) = -\log\sigma – \tfrac12\log(2\pi) – \frac{(x-\mu)^2}{2\sigma^2}
∂log⁡f∂μ=x−μσ2,∂2log⁡f∂μ2=−1σ2,i(μ)=1σ2,bound=σ2n=Var(Xˉ) \frac{\partial \log f}{\partial\mu} = \frac{x-\mu}{\sigma^2}, \qquad \frac{\partial^2 \log f}{\partial\mu^2} = -\frac{1}{\sigma^2}, \qquad i(\mu) = \frac{1}{\sigma^2}, \qquad \text{bound} = \frac{\sigma^2}{n} = \text{Var}(\bar X)

Xˉ \bar X is efficient for μ. Here the second derivative does not even depend on x: the expectation is immediate.

Using the density of the whole sample in i(θ) i(\theta) and then dividing by n again. If you differentiate log⁡L(θ)=∑log⁡f(xi∣θ) \log L(\theta) = \sum \log f(x_i\mid\theta) , what comes out is already n i(θ) n\,i(\theta) and the bound is its inverse, with no extra n. Pick one of the two forms and do not mix them.

Result for the cheat sheet: i(θ)=−E[∂θ2log⁡f(X∣θ)] i(\theta) = -E[\partial^2_\theta \log f(X\mid\theta)] ; bound =1/(n i(θ)) = 1/(n\,i(\theta)) . Poisson: i=1/λ i = 1/\lambda , bound λ/n \lambda/n . Normal (μ): i=1/σ2 i = 1/\sigma^2 , bound σ2/n \sigma^2/n . Exponential: i=1/λ2 i = 1/\lambda^2 , bound λ2/n \lambda^2/n .

Check it with R

The information is also the expectation of the square of the first derivative. With λ = 3.04 (the trips per hour) and the normal of the distances, computing that expectation with rule 5:

l <- 3.04; x <- 0:100
i_pois <- sum((-1 + x / l)^2 * dpois(x, l))            # E[(d log f / d lambda)^2]
i_norm <- integrate(function(x) ((x - 2.4) / 0.49)^2 * dnorm(x, 2.4, 0.7), -Inf, Inf)$value
round(c(i_pois = i_pois, theo_pois = 1 / l, i_norm = i_norm, theo_norm = 1 / 0.49), 4)

Output:

   i_pois theo_pois    i_norm theo_norm 
   0.3289    0.3289    2.0408    2.0408 

Both forms of the information agree: 0.3289 = 1/3.04 and 2.0408 = 1/0.49.

Check you’ve got it: the estimator that always says 3, without looking at the data, has variance 0, less than the bound λ/n. Does it break Cramér–Rao?

No: the bound is for unbiased estimators, and this one has bias 3−λ 3 – \lambda . If λ = 3.04, its MSE is (3−3.04)2=0.0016 (3 – 3.04)^2 = 0.0016 ; if λ were 2, it would be 1, and you cannot know without looking at the data. Without that condition, guessing right by luck would always win.

Proof 7: the exponential MLE, bias, correction and asymptotic variance

What we want to prove

For an exponential(λ) with λ^=1/Xˉ \hat\lambda = 1/\bar X (the MLE, from the previous topic):

  1. E(λ^)=nn−1λ E(\hat\lambda) = \frac{n}{n-1}\lambda : biased, but asymptotically unbiased.
  2. λ∗=n−1nXˉ \lambda^* = \frac{n-1}{n\bar X} is unbiased, with Var(λ∗)=λ2n−2 \text{Var}(\lambda^*) = \frac{\lambda^2}{n-2} , which does not reach the bound λ2n \frac{\lambda^2}{n} but gets closer to it.
  3. The asymptotic variance of λ^ \hat\lambda is λ^2/n \hat\lambda^2/n .

Why it matters. It puts the whole topic into one model: bias, correction, variance, bound and asymptotic variance. And it shows that the MLE can be biased: Xˉ \bar X is unbiased, but its reciprocal is not.

Where we start

Y=∑Xi∼gamma(n,λ) Y = \sum X_i \sim \text{gamma}(n, \lambda) (rule 7), and λ^=n/Y \hat\lambda = n/Y .

Step 1: the expectation of 1/Y

By rule 5, with the gamma density:

E(1Y)=∫0∞1y⋅λnΓ(n)yn−1e−λy dy=λnΓ(n)∫0∞yn−2e−λy dy=λnΓ(n)⋅Γ(n−1)λn−1 E\left(\frac1Y\right) = \int_0^\infty \frac1y \cdot \frac{\lambda^n}{\Gamma(n)}y^{n-1}e^{-\lambda y}\,dy = \frac{\lambda^n}{\Gamma(n)}\int_0^\infty y^{n-2}e^{-\lambda y}\,dy = \frac{\lambda^n}{\Gamma(n)}\cdot\frac{\Gamma(n-1)}{\lambda^{n-1}}

The integral is the one in rule 7 with a = n − 1. And since Γ(n)=(n−1)Γ(n−1) \Gamma(n) = (n-1)\Gamma(n-1) :

E(1Y)=λn−1(n≥2) E\left(\frac1Y\right) = \frac{\lambda}{n-1} \qquad (n \ge 2)

What gets skipped: λnλn−1=λ \frac{\lambda^n}{\lambda^{n-1}} = \lambda and Γ(n−1)Γ(n)=1n−1 \frac{\Gamma(n-1)}{\Gamma(n)} = \frac{1}{n-1} . With n = 1, the integral of y−1e−λy y^{-1}e^{-\lambda y} does not converge near 0.

Step 2: the bias of the MLE

E(λ^)=n E(1Y)=nn−1λ,b(λ^)=λn−1→n→∞0 E(\hat\lambda) = n\,E\left(\frac1Y\right) = \frac{n}{n-1}\lambda, \qquad b(\hat\lambda) = \frac{\lambda}{n-1} \xrightarrow[n\to\infty]{} 0

It overshoots (with 20 trips, by 5 %), but it is asymptotically unbiased.

Step 3: correct it

Multiplying by n−1n \frac{n-1}{n} : λ∗=n−1nλ^=n−1Y \lambda^* = \frac{n-1}{n}\hat\lambda = \frac{n-1}{Y} has E(λ∗)=(n−1)λn−1=λ E(\lambda^*) = (n-1)\frac{\lambda}{n-1} = \lambda . Unbiased.

Step 4: its variance

We need E(1/Y2) E(1/Y^2) , as in step 1 but with y−2 y^{-2} :

E(1Y2)=λnΓ(n)⋅Γ(n−2)λn−2=λ2(n−1)(n−2)(n≥3) E\left(\frac{1}{Y^2}\right) = \frac{\lambda^n}{\Gamma(n)}\cdot\frac{\Gamma(n-2)}{\lambda^{n-2}} = \frac{\lambda^2}{(n-1)(n-2)} \qquad (n \ge 3)

using Γ(n)=(n−1)(n−2)Γ(n−2) \Gamma(n) = (n-1)(n-2)\Gamma(n-2) . By rule 3:

Var(λ∗)=(n−1)2 λ2(n−1)(n−2)−λ2=λ2(n−1n−2−1)=λ2n−2 \text{Var}(\lambda^*) = (n-1)^2\,\frac{\lambda^2}{(n-1)(n-2)} – \lambda^2 = \lambda^2\left(\frac{n-1}{n-2} – 1\right) = \frac{\lambda^2}{n-2}

Why (n−1)2 (n-1)^2 : λ∗=(n−1)/Y \lambda^* = (n-1)/Y , so E(λ∗2)=(n−1)2 E(1/Y2) E(\lambda^{*2}) = (n-1)^2\,E(1/Y^2) , and E(λ∗)2=λ2 E(\lambda^*)^2 = \lambda^2 is subtracted from it.

Step 5: compare it with the bound

In the exponential, log⁡f=log⁡λ−λx \log f = \log\lambda – \lambda x , ∂λ2log⁡f=−1/λ2 \partial^2_\lambda \log f = -1/\lambda^2 , i(λ)=1/λ2 i(\lambda) = 1/\lambda^2 and the bound is λ2/n \lambda^2/n . Since λ2n−2>λ2n \frac{\lambda^2}{n-2} > \frac{\lambda^2}{n} , λ∗ \lambda^* is not efficient. But the ratio nn−2→1 \frac{n}{n-2} \to 1 : it is asymptotically efficient, as property 4 of the MLE promises.

Step 6: the asymptotic variance

With ℓ(λ)=nlog⁡λ−λ∑xi \ell(\lambda) = n\log\lambda – \lambda\sum x_i :

ℓ′(λ)=nλ−∑xi,ℓ′′(λ)=−nλ2,Var(λ^)≈−1ℓ′′(λ^)=λ^2n \ell'(\lambda) = \frac n\lambda – \sum x_i, \qquad \ell''(\lambda) = -\frac{n}{\lambda^2}, \qquad \text{Var}(\hat\lambda) \approx -\frac{1}{\ell''(\hat\lambda)} = \frac{\hat\lambda^2}{n}

Which is the bound with λ replaced by its estimate.

Why −1/ℓ′′ -1/\ell'' : by the MLE property from the previous topic, its asymptotic variance is the inverse of the information of the whole sample, n/λ2 n/\lambda^2 , with λ^ \hat\lambda in place of λ.

Writing E(1/Xˉ)=1/E(Xˉ)=λ E(1/\bar X) = 1/E(\bar X) = \lambda . Expectation does not pass through 1/x 1/x (it is not linear), and the difference is exactly the bias.

Result for the cheat sheet: exponential: E(1/Xˉ)=nn−1λ E(1/\bar X) = \frac{n}{n-1}\lambda ; n−1nXˉ \frac{n-1}{n\bar X} unbiased with variance λ2n−2 \frac{\lambda^2}{n-2} ; bound λ2n \frac{\lambda^2}{n} ; Var(λ^)≈λ^2/n \text{Var}(\hat\lambda) \approx \hat\lambda^2/n .

Check it with R

With λ = 1/12 (trips of 12 minutes on average) and n = 20:

set.seed(3)
lam <- 1 / 12; n <- 20
lh <- replicate(20000, 1 / mean(rexp(n, lam)))          # 20,000 MLEs
lc <- (n - 1) / n * lh                                    # the corrected ones
round(c(mean_mle = mean(lh), theo = n / (n - 1) * lam,
        mean_cor = mean(lc), lambda = lam,
        var_cor = var(lc), theo_var = lam^2 / (n - 2), bound = lam^2 / n), 5)

Output:

mean_mle     theo mean_cor   lambda  var_cor theo_var    bound 
 0.08779  0.08772  0.08340  0.08333  0.00039  0.00039  0.00035 

The MLE goes to 0.0878, above λ = 0.0833, as 2019λ \frac{20}{19}\lambda says. The corrected one centres on λ, and its variance (0.00039) sits on the formula λ2/18 \lambda^2/18 , a little above the bound λ2/20 \lambda^2/20 .

Check you’ve got it: with 20 trips and a mean of 12 minutes, what are the MLE, the corrected estimator and the asymptotic standard deviation of the MLE?

λ^=1/12=0.0833 \hat\lambda = 1/12 = 0.0833 trips per minute; λ∗=1920⋅12=0.0792 \lambda^* = \frac{19}{20\cdot 12} = 0.0792 , 5 % less; and λ^/20=0.0186 \hat\lambda/\sqrt{20} = 0.0186 (step 6). The correction removes 0.0042, much less than the spread: with 20 data points, more data matters more than the bias.

Prove it yourself

Three EC2-style proofs. Try them on paper before opening the solution.

1. Let X1,…,Xn X_1, \dots, X_n be a simple random sample from a Bernoulli(p) (the scooter you find is faulty, 1, or not, 0). Prove that p^=Xˉ \hat p = \bar X is unbiased, consistent and efficient.

See the solution to 1

Unbiased: E(Xˉ)=E(X)=p E(\bar X) = E(X) = p .

Consistent: Var(Xˉ)=p(1−p)n→0 \text{Var}(\bar X) = \frac{p(1-p)}{n} \to 0 and it is unbiased: by the consistency theorem, it is.

Efficient: log⁡f(x∣p)=xlog⁡p+(1−x)log⁡(1−p) \log f(x\mid p) = x\log p + (1-x)\log(1-p) . Differentiating:

∂log⁡f∂p=xp−1−x1−p,∂2log⁡f∂p2=−xp2−1−x(1−p)2 \frac{\partial \log f}{\partial p} = \frac xp – \frac{1-x}{1-p}, \qquad \frac{\partial^2 \log f}{\partial p^2} = -\frac{x}{p^2} – \frac{1-x}{(1-p)^2}
i(p)=E(X)p2+1−E(X)(1−p)2=1p+11−p=1p(1−p) i(p) = \frac{E(X)}{p^2} + \frac{1 – E(X)}{(1-p)^2} = \frac1p + \frac{1}{1-p} = \frac{1}{p(1-p)}

The bound is p(1−p)n=Var(Xˉ) \frac{p(1-p)}{n} = \text{Var}(\bar X) : efficient.

2. In a normal population, prove that S2 S^2 is a consistent estimator of σ².

See the solution to 2

By proof 1, E(S2)=σ2 E(S^2) = \sigma^2 for every n. By proof 5 (rule 6), Var(S2)=2σ4n−1 \text{Var}(S^2) = \frac{2\sigma^4}{n-1} , which goes to 0 as n → ∞. By the consistency theorem (rule 8), S2 S^2 is consistent. And so is S′2 S'^2 : E(S′2)→σ2 E(S'^2) \to \sigma^2 and Var(S′2)=2(n−1)σ4n2→0 \text{Var}(S'^2) = \frac{2(n-1)\sigma^4}{n^2} \to 0 .

3. Let X1,…,Xn X_1, \dots, X_n be a simple random sample from a N(μ,1) N(\mu, 1) . By invariance, Xˉ2 \bar X^2 is the MLE of μ². Prove that it is biased, compute its bias, check that it is asymptotically unbiased and give an unbiased estimator of μ².

See the solution to 3

Xˉ∼N(μ,1/n) \bar X \sim N(\mu, 1/\sqrt n) , so Var(Xˉ)=1/n \text{Var}(\bar X) = 1/n . By rule 3:

E(Xˉ2)=Var(Xˉ)+E(Xˉ)2=1n+μ2,b(Xˉ2)=1n E(\bar X^2) = \text{Var}(\bar X) + E(\bar X)^2 = \frac1n + \mu^2, \qquad b(\bar X^2) = \frac1n

It is biased (it overshoots by 1/n), but E(Xˉ2)→μ2 E(\bar X^2) \to \mu^2 : asymptotically unbiased. Subtracting the bias, Xˉ2−1n \bar X^2 – \frac1n is unbiased: E(Xˉ2−1n)=μ2 E\left(\bar X^2 – \frac1n\right) = \mu^2 . Careful: with small samples it can give a negative number, which makes no sense as an estimate of a square. Unbiased is not the same as sensible (as with the fleet).

When to use each result

If you are asked…UseWatch out for…
to prove it is unbiasedE(θ^) E(\hat\theta) with linearity (rule 1)E(1/Xˉ)≠1/E(Xˉ) E(1/\bar X) \ne 1/E(\bar X)
the biasb=E(θ^)−θ b = E(\hat\theta) – \theta the sign: negative = it falls short
the MSEVar+b2 \text{Var} + b^2 (proof 2)the square of the bias
which is more efficientratio of MSEs, cancelling θread whether they compare variances or MSEs
whether it is efficienti(θ) i(\theta) of one observation and 1/(n i) 1/(n\,i) that it is unbiased and the support does not depend on θ
whether it is consistentE→θ E \to \theta and Var→0 \text{Var} \to 0 (rule 8)both conditions, not just the first
something about the maximum or minimumP(X(n)≤x)=F(x)n P(X_{(n)} \le x) = F(x)^n the minimum: P(X(1)>x)=(1−F(x))n P(X_{(1)} > x) = (1 – F(x))^n
the asymptotic variance of the MLE−1/ℓ′′(θ^) -1/\ell''(\hat\theta) evaluate it at θ^ \hat\theta , not at θ

Common mistakes when proving

  • Skipping rule 3 and writing E(Xˉ2)=μ2 E(\bar X^2) = \mu^2 or E(X2)=E(X)2 E(X^2) = E(X)^2 .
  • Forgetting to square the bias in the MSE.
  • Putting the n in twice in the Cramér–Rao bound (information of the sample and then dividing by n as well).
  • Applying Cramér–Rao to the uniform(0, θ), whose support depends on θ.
  • Concluding “not consistent” because there is bias. Consistency asks for the bias to vanish, not for it to be absent.
  • Using the minimum’s distribution for the maximum (or the other way round). Check at the end point: the maximum’s equals 1 at x = θ.
  • Writing “it is easy to see that”. In the exam what counts is the step that justifies each equality; if you do not know which rule you are using, the step is wrong.

Try it in the R playground

Paste this script into the R playground. It checks proofs 3 and 4 at once with n = 8:

set.seed(10)
theta <- 2400; n <- 8
m <- replicate(20000, max(runif(n, 0, theta)))
c(mean_sim = mean(m), mean_theo = n / (n + 1) * theta,
  var_sim = var(m),   var_theo  = n * theta^2 / ((n + 1)^2 * (n + 2)),
  mse_max = mean((m - theta)^2), mse_theo = 2 * theta^2 / ((n + 1) * (n + 2)))
hist(m, breaks = 50, freq = FALSE, main = "Maximum of 8 serial numbers", xlab = "scooters")
curve(n * x^(n - 1) / theta^n, add = TRUE, col = "red", lwd = 2)

What to look at:

  1. In the console, each simulated value next to its formula.
  2. In Plots, the histogram pressed to the right and the red density curve nxn−1/θn n x^{n-1}/\theta^n on top.
  3. Change n to 2: the density becomes a straight line (2x/θ2 2x/\theta^2 ).
  4. Type ?replicate in the console to see the help in the Help panel.

Summary

ResultFormula
Bias of S′2 S'^2 −σ2/n -\sigma^2/n
MSEVar(θ^)+b(θ^)2 \text{Var}(\hat\theta) + b(\hat\theta)^2
Maximum of the uniform(0, θ)E=nn+1θ E = \frac{n}{n+1}\theta , Var=nθ2(n+1)2(n+2) \text{Var} = \frac{n\theta^2}{(n+1)^2(n+2)}
Best fleet estimatorn+1nX(n) \frac{n+1}{n}X_{(n)} , MSE θ2n(n+2) \frac{\theta^2}{n(n+2)}
MSE of S2 S^2 and S′2 S'^2 (normal)2σ4n−1 \frac{2\sigma^4}{n-1} and (2n−1)σ4n2 \frac{(2n-1)\sigma^4}{n^2}
Cramér–Rao bound1/(n i(θ)) 1/(n\,i(\theta)) ; Poisson λ/n, normal σ²/n
Exponential MLEE(λ^)=nn−1λ E(\hat\lambda) = \frac{n}{n-1}\lambda ; Var(λ^)≈λ^2/n \text{Var}(\hat\lambda) \approx \hat\lambda^2/n

Three ideas to take away:

  1. Almost everything comes from two tools: rule 3 (E(X2)=Var+E2 E(X^2) = \text{Var} + E^2 ) and the MSE decomposition.
  2. For anything about the maximum, start with “the maximum is below x if all of them are”.
  3. The Cramér–Rao bound is always computed the same way: log of one observation, two derivatives, expectation with the sign changed and divide by n.

With this you can simulate it all in the properties of estimators practice and then take on the exam-style exercises.

Next step: practiceProperties of estimators — R practice with simulations of bias, MSE, the Cramér–Rao bound and consistency (and the 10,000 variances I did not ask for)

Did this article help you? Here is how you can support SergioLearns →