Foundations to Frontier
Tests
A. Mathematical Foundations › A5 Statistics › Descriptive and inferential statistics

Maximum Likelihood Estimation (MLE)

Choose the parameter under which the observed data were most probable. Maximum likelihood gives closed forms for the standard families (proportions, means, rates), a recipe for everything else (maximize the log-likelihood numerically), and a complete asymptotic theory: the MLE is consistent, asymptotically normal, and efficient, with standard errors from the curvature of the log-likelihood (Fisher information). You will fit Weibull lifetimes with Newton's method, handle censored life tests correctly, build likelihood-ratio intervals, and see the MLE behind least squares, cross-entropy and system identification.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Which coin did this?

You flip a coin 10 times and see 8 heads. Which is more believable: a fair coin (50%), or a coin that lands heads 80% of the time? The 80% coin makes “8 heads” much more likely. Maximum likelihood says: pick the explanation under which what you saw was most probable. Here, that’s 80%.

It’s the most widely used way to fit models to data, from a robot’s success rate to the millions of weights in a neural network.

Find the parameter that makes the data most likely
MLE p̂ = 0.700 (true 0.80) · SE from curvature 0.145 · likelihood-ratio 95% interval [0.394, 0.913]
Blue: the log-likelihood ℓ(θ) = Σ log f(xᵢ; θ) (shown down to 8 units below its peak). Orange: its maximum, the MLE. Green dashed: the truth. Shaded: the values within 1.92 of the peak, a 95% likelihood-ratio interval. The sharper the peak (the larger the curvature, which is the observed Fisher information), the smaller the SE = 1/√curvature. Quadrupling n roughly halves the width. Try Bernoulli with all successes: the MLE sits at the edge and the interval is one-sided.
Why engineers care

Estimating failure rates from life tests, sensor noise levels from logs, motor parameters from experiments, and training classifiers all use maximum likelihood. It also tells you how uncertain the estimate is, from the “sharpness” of the likelihood peak.

📝 Quick check (Level 0)
0/3 answered
  1. 1. 8 heads in 10 flips: the maximum-likelihood chance of heads is…
  2. 2. Maximum likelihood picks the parameter that makes the data…
  3. 3. A sharper likelihood peak means…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Definition

For iid data with density or PMF f(x;θ)f(x;\theta), the likelihood is L(θ)=∏if(xi;θ)L(\theta) = \prod_if(x_i;\theta), viewed as a function of θ\theta. The log-likelihood ℓ(θ)=∑log⁡f(xi;θ)\ell(\theta) = \sum\log f(x_i;\theta) is easier to work with. The MLE is θ^=arg⁡max⁡ℓ(θ)\hat\theta = \arg\max\ell(\theta), usually found by solving the score equation ℓ′(θ)=0\ell'(\theta) = 0.

Closed forms

Model MLE
Bernoulli(p) p^=xˉ\hat p = \bar x (the success fraction)
Poisson(λ) λ^=xˉ\hat\lambda = \bar x
Exponential(rate λ) λ^=1/xˉ\hat\lambda = 1/\bar x
Normal(μ, σ²) μ^=xˉ\hat\mu = \bar x, σ^2=1n∑(xi−xˉ)2\hat\sigma^2 = \frac1n\sum(x_i - \bar x)^2 (÷n, biased)
Uniform(0, θ) θ^=max⁡xi\hat\theta = \max x_i (the likelihood isn’t differentiable there)

Invariance: the MLE of g(θ)g(\theta) is g(θ^)g(\hat\theta). For example, the MLE of the median life of an exponential is ln⁡2/λ^\ln2/\hat\lambda.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Poisson counts 3, 1, 4, 1, 5: λ̂ =
  2. 2. Exponential lifetimes with mean 200 h: rate MLE?
  3. 3. The normal MLE of σ² divides by…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

Asymptotic theory

Under regularity conditions (smooth model, identifiable, true θ\theta inside the parameter space):

  1. Consistency: θ^→Pθ\hat\theta\xrightarrow P\theta.
  2. Asymptotic normality: n(θ^−θ)→dN(0,I(θ)−1)\sqrt n(\hat\theta - \theta)\xrightarrow d\mathcal N(0, I(\theta)^{-1}).
  3. Efficiency: the asymptotic variance attains the Cramér–Rao bound (A5.1-3).

In practice, the SE comes from the observed information, the negative second derivative (Hessian) of ℓ\ell at θ^\hat\theta: SE⁡^=1/−ℓ′′(θ^)\widehat{\operatorname{SE}} = 1/\sqrt{-\ell''(\hat\theta)}. With several parameters, invert the negative Hessian.

Three ways to build intervals and tests

  • Wald: θ^±1.96 SE⁡^\hat\theta\pm1.96\,\widehat{\operatorname{SE}}. Simple, but symmetric, and it can leave the parameter space (for example a proportion near 1).
  • Likelihood ratio: {θ:2[ℓ(θ^)−ℓ(θ)]≤3.84}\{\theta : 2[\ell(\hat\theta) - \ell(\theta)]\le3.84\}, using Wilks’ χ12\chi^2_1 limit. It respects the parameter’s shape and range.
  • Score test: uses only ℓ′\ell' at the null value.

When there’s no closed form: Newton’s method

Iterate θ←θ−ℓ′(θ)/ℓ′′(θ)\theta\leftarrow\theta - \ell'(\theta)/\ell''(\theta). Fisher scoring replaces ℓ′′\ell'' by −nI(θ)-nI(\theta). For the Weibull lifetime model, the scale has a closed form given the shape, so Newton is only needed in one dimension (profile likelihood, Exercise 1). Logistic regression and GLMs are fitted the same way (IRLS).

🐍 Exercise 1: Weibull lifetime MLE by Newton's method
Fit a Weibull distribution to 300 bearing lifetimes: profile out the scale and solve for the shape by Newton. Check that it maximizes the likelihood, get SEs from the observed information (and compare with repeated experiments), and use invariance for the median life.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The MLE's asymptotic variance is…
  2. 2. The likelihood-ratio 95% interval keeps θ with 2[ℓ(θ̂) − ℓ(θ)] ≤ …
  3. 3. SE from the observed information =

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Why the MLE is asymptotically normal

Taylor-expand the score around the true θ0\theta_0: 0=ℓ′(θ^)≈ℓ′(θ0)+ℓ′′(θ0)(θ^−θ0)0 = \ell'(\hat\theta)\approx\ell'(\theta_0) + \ell''(\theta_0)(\hat\theta - \theta_0). So

n(θ^−θ0)≈n−1/2ℓ′(θ0)−n−1ℓ′′(θ0)\sqrt n(\hat\theta - \theta_0)\approx\frac{n^{-1/2}\ell'(\theta_0)}{-n^{-1}\ell''(\theta_0)}
  1. Numerator. It’s a scaled sum of iid scores with mean 0 and variance II, so it tends to N(0,I)\mathcal N(0, I) by the CLT.
  2. Denominator. It tends to II by the LLN.
  3. Conclude. Slutsky gives N(0,I−1)\mathcal N(0, I^{-1}) (A4.3-8). ∎

Why maximizing likelihood makes sense: KL divergence

1nℓ(θ)→Eθ0[log⁡f(X;θ)]=−H(fθ0)−KL⁡(fθ0 ∥ fθ)\frac1n\ell(\theta)\to\mathbb E_{\theta_0}[\log f(X;\theta)] = -H(f_{\theta_0}) - \operatorname{KL}(f_{\theta_0}\,\|\,f_\theta). So the MLE minimizes the KL divergence from the data distribution to the model. If the model is misspecified, it converges to the KL-closest member, and the right SEs are the sandwich (Huber–White) form A−1BA−1A^{-1}BA^{-1}, with A=−Eℓ′′A = -\mathbb E\ell'' and B=Var⁡ℓ′B = \operatorname{Var}\ell'.

Familiar losses are negative log-likelihoods

  • Least squares is the Gaussian-noise MLE.
  • L1 regression is the Laplace-noise MLE.
  • Cross-entropy is the categorical MLE.
  • Poisson regression is the count MLE.

Choosing a loss is choosing a noise model.

Exercise 3.1: Derive the censored-exponential MLE

Units that fail at tit_i contribute λe−λti\lambda e^{-\lambda t_i}. Units still working at tit_i contribute e−λtie^{-\lambda t_i}. So ℓ=rlog⁡λ−λ∑ti\ell = r\log\lambda - \lambda\sum t_i with rr failures, and λ^=r/∑ti\hat\lambda = r/\sum t_i: failures divided by total time on test.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The MLE minimizes the KL divergence from…
  2. 2. Under misspecification, correct SEs use…
  3. 3. Least squares is the MLE for…

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Life testing with censoring

You test 400 thrusters for 2000 hours. Most are still working when the test stops. They’re right-censored: you only know they lasted at least 2000 h. Averaging the failure times of the few that failed ignores this, and overstates the failure rate about 5×. The censored likelihood counts survivors through e−λTe^{-\lambda T}, giving λ^=r/total time on test\hat\lambda = r/\text{total time on test}. With the Fisher information r/λ2r/\lambda^2, it gives honest 95% intervals. Censoring is everywhere in reliability, in robot task-completion times with timeouts, and in survival analysis (Kaplan–Meier, Cox).

🐍 Exercise 2 (research): MLE for a censored life test
Simulate 1000 life tests of 400 exponential thrusters (mean life 5000 h) stopped at 2000 h. Show that the censored MLE is nearly unbiased, that using only the failure times grossly overstates the failure rate, and that Wald intervals with SE = λ̂/√r cover about 95%.

MLE in AI, robotics and aerospace

  • Deep learning. Training with cross-entropy or Gaussian negative log-likelihood is maximum likelihood. Overfitting is the MLE’s small-sample weakness, which regularization (MAP, A5.2-2) addresses.
  • System identification. Fitting robot dynamics, aerodynamic coefficients or battery models to data uses (prediction-error) maximum likelihood. For state-space models, the Kalman filter’s innovations give the likelihood (Ljung, 1999; Shumway and Stoffer, 1982).
  • Sensor noise calibration. MLE fits of noise variances and Allan parameters, and EM for unknown process/measurement covariances (A5.2-10).
  • Reliability and survival. Weibull/lognormal fits to censored life data underpin component qualification (Meeker and Escobar, 1998).
  • Tracking. Maximum-likelihood data association and ML-PDA trackers (Bar-Shalom, Willett and Tian, 2011).

References

  1. R. A. Fisher (1922). “On the mathematical foundations of theoretical statistics.” Phil. Trans. R. Soc. A, 222.
  2. S. Wilks (1938). “The large-sample distribution of the likelihood ratio for testing composite hypotheses.” Annals of Mathematical Statistics, 9(1).
  3. A. van der Vaart (1998). Asymptotic Statistics, Ch. 5. Cambridge University Press.
  4. H. White (1982). “Maximum likelihood estimation of misspecified models.” Econometrica, 50(1).
  5. W. Meeker, L. Escobar (1998). Statistical Methods for Reliability Data. Wiley.
  6. L. Ljung (1999). System Identification: Theory for the User, 2nd ed. Prentice Hall.
  7. R. Shumway, D. Stoffer (1982). “An approach to time series smoothing and forecasting using the EM algorithm.” Journal of Time Series Analysis, 3(4).
  8. Y. Bar-Shalom, P. Willett, X. Tian (2011). Tracking and Data Fusion. YBS Publishing.
  9. Y. Pawitan (2001). In All Likelihood. Oxford University Press.
  10. W. Weibull (1951). “A statistical distribution function of wide applicability.” Journal of Applied Mechanics, 18.