Solution: MLE for a Normal with Unknown Mean and Variance
Parts 1–2
.
.
. Substituting :
Part 3
.
So . MLE variance is biased downward.
Part 4
Bessel-corrected estimator: , with . This is what
numpy.var(x, ddof=1) computes.Part 5 — Simulation
import numpy as np
rng = np.random.default_rng(0)
m, n = 10_000, 10
X = rng.standard_normal((m, n))
mle_var = np.mean(X.var(axis=1, ddof=0))
bessel_var = np.mean(X.var(axis=1, ddof=1))
print(f"average MLE variance: {mle_var:.4f} (expected (n-1)/n = {(n-1)/n:.4f})")
print(f"average Bessel variance: {bessel_var:.4f} (expected 1.0)")
# average MLE variance: 0.9036 (expected (n-1)/n = 0.9000)
# average Bessel variance: 1.0040 (expected 1.0)Takeaways
- MLE for is and is unbiased ().
- MLE for is biased downward by a factor . The bias arises because — using instead of reduces variability by one degree of freedom.
- Bessel correction divides by instead of to recover an unbiased estimator. This is the default in scientific computing libraries.
- MLE's asymptotic unbiasedness kicks in as : . For in the thousands, the MLE and Bessel estimators are indistinguishable; in small samples (monthly data, rare events), the distinction matters.
- Efficiency vs. unbiasedness trade-off. The MLE has smaller variance than the Bessel-corrected estimator, but is biased. The MSE of MLE is slightly smaller for small .