Maximum Likelihood Estimation (MLE)
Volume I, Chapter 3 — Part V. The likelihood function, log-likelihood, MLE derivations for exponential family distributions, consistency and asymptotic normality, Fisher information, Cramér-Rao bound, and the equivalence to cross-entropy minimization.
Prerequisites
Table of Contents
- Learning Objectives
- Prerequisites
- Notation
- Core Intuition
- The Likelihood Function and Likelihood Principle
- Maximum Likelihood Estimation
- Log-Likelihood and Computational Advantages
- MLE for Exponential Family Distributions
- Score Function and Fisher Information
- Consistency of the MLE
- Asymptotic Normality and the Cramér-Rao Bound
- Invariance and Functional MLE
- MLE as KL Minimization and Cross-Entropy
- MLE for Neural Networks
- Limitations and the Path to Bayesian Methods
- Common Pitfalls and Misconceptions
- Research Perspective
- Summary of Takeaways
- Exercises
Learning Objectives
After reading this chapter, you should be able to:
- Define the likelihood function and distinguish it from a PDF over parameters.
- Derive MLEs for Gaussian, Bernoulli, Poisson, and exponential family distributions.
- State and interpret the score function and Fisher information matrix.
- State consistency and asymptotic normality theorems for the MLE and sketch their proofs.
- Explain the Cramér-Rao lower bound and asymptotic efficiency of the MLE.
- Prove that MLE minimizes KL divergence to the empirical distribution and equates to cross-entropy minimization.
- Identify MLE as the foundation of MSE loss, cross-entropy loss, and neural network training.
Prerequisites
- Bayes' Theorem: likelihood, posterior, prior; connection to MAP.
- KL Divergence: , cross-entropy equivalence.
- Entropy & Information Content: entropy, expected log-probability.
- Gradient Descent: optimization of log-likelihood via gradients.
Notation
- — Observed dataset
- — Model parameters
- — Likelihood and log-likelihood
- — Maximum likelihood estimator
- — Fisher information
- — Observed information
Core Intuition
Given data , we posit a parametric family and ask: which parameter value makes the observed data most probable? This is Maximum Likelihood Estimation (MLE) — the dominant paradigm for parameter learning in statistics and machine learning.
When you train a neural network with cross-entropy loss, you are performing MLE under a categorical model. When you minimize MSE for regression, you are performing MLE under Gaussian noise. The loss functions of deep learning are not arbitrary — they are derived from probabilistic assumptions via the likelihood principle.
MLE has elegant asymptotic theory: under regularity conditions, is consistent (converges to the true parameter), asymptotically normal (with variance governed by Fisher information), and efficient (achieves the Cramér-Rao lower bound). These guarantees explain why MLE is the default — and why its limitations (overfitting, no uncertainty quantification) motivate Bayesian extensions.
Series context. This is Part V of Chapter 3 in Volume I. It precedes Bias–Variance Tradeoff and connects to Linear Regression and Logistic Regression in Volume II.
Interactive: Maximum Likelihood Estimation
μ̂_MLE
1.728
σ̂_MLE
0.824
The Likelihood Function and Likelihood Principle
Setup. Observations are i.i.d. from unknown distribution , modeled by parametric family .
Definition 1 (Likelihood Function). The likelihood function is the probability (or density) of the observed data viewed as a function of parameters:
The i.i.d. factorization is essential.
Critical distinction.
- — (fixed ) — — it is a PMF/PDF
- — (fixed data) — Not necessarily
Example. For Bernoulli trials with successes: . As a function of , this integrates to 1 over only for specific — it is not a density on without a prior (Bayesian view).
Likelihood Principle (Informal). All evidence about from the experiment is contained in . Two experiments with proportional likelihoods () yield identical inference about .
Maximum Likelihood Estimation
Definition 2 (Maximum Likelihood Estimator). The MLE is:
Definition 3 (Log-Likelihood). The log-likelihood is:
Since is strictly increasing, .
Proposition 1 (First-Order Condition). If is in the interior of and is differentiable, then:
Proof. Necessary condition for an interior maximum of a differentiable function.
Proposition 2 (Second-Order Condition). If additionally (negative Hessian positive definite), then is a local maximum.
Log-Likelihood and Computational Advantages
Why log?
- Products become sums: — numerically stable, avoids underflow.
- Exponential family: Log-likelihood is often concave, enabling closed-form or convex optimization.
- Gradients decompose: — supports stochastic gradients (SGD).
Proposition 3. For i.i.d. data, where is the empirical distribution.
MLE for Exponential Family Distributions
Definition 4 (Exponential Family). A distribution with density:
where are sufficient statistics, are natural parameters, and is the log-partition function.
Theorem 1 (MLE for Exponential Family). For i.i.d. samples from an exponential family, the MLE satisfies:
i.e., match expected sufficient statistics to sample averages.
Gaussian — Known Variance
, known:
Gaussian — Unknown Mean and Variance
Remark. divides by , not — it is biased. The unbiased estimator uses Bessel's correction (). This bias–variance tradeoff is developed in Bias–Variance Tradeoff.
Bernoulli
, :
Poisson
:
Score Function and Fisher Information
Definition 5 (Score Function). The score is the gradient of the log-likelihood for a single observation:
For i.i.d. observations: .
Proposition 4 (Score Has Zero Expectation). Under regularity conditions:
Proof.
(Exchange of derivative and integral justified by regularity.)
Definition 6 (Fisher Information). The Fisher information matrix is:
The second equality follows from differentiating w.r.t. .
Interpretation. measures the curvature of the log-likelihood — how sharply peaked it is around the true parameter. Large Fisher information data are highly informative about lower variance of estimators.
Example (Bernoulli). . Information is lowest at (hardest to distinguish from noise) and diverges at .
Example (Gaussian, known ). .
Consistency of the MLE
Definition 7 (Consistency). Estimator is consistent for if as .
Theorem 2 (Consistency of MLE). Under regularity conditions (identifiability, compact , continuity, dominance for exchange of limit and integral):
where — the KL-closest parameter if is not in the model.
Proof sketch.
Step 1. By the Law of Large Numbers:
Step 2. By identifiability, is uniquely maximized at (true parameter if model is correct).
Step 3. By uniform convergence (regularity) and the argmax continuous mapping theorem, .
Interpretation. With enough data, MLE finds the best parameter in the model family — in the KL sense from KL Divergence, Theorem 3.
Asymptotic Normality and the Cramér-Rao Bound
Theorem 3 (Asymptotic Normality of MLE). Under regularity conditions, as :
Proof sketch. Taylor expand the score at around :
Rearranging:
By LLN: . By CLT: . Slutsky's theorem gives (19).
Theorem 4 (Cramér-Rao Lower Bound). For any unbiased estimator of :
Proof sketch. Cauchy–Schwarz inequality on with .
Corollary 2 (Asymptotic Efficiency). The MLE achieves the Cramér-Rao bound asymptotically — it is the most efficient regular estimator in the large-sample limit.
Invariance and Functional MLE
Theorem 5 (Invariance of MLE). If is the MLE of , then for any function , the MLE of is:
Proof. The likelihood depends on only through when reparameterizing; maximizing over is equivalent to maximizing over and applying .
Example. For Gaussian variance, . The MLE of is , not divided differently — invariance gives .
MLE as KL Minimization and Cross-Entropy
Theorem 6 (MLE KL Minimization). The MLE minimizes KL divergence from the empirical distribution:
Proof. From KL Divergence, Theorem 3.
Theorem 7 (Cross-Entropy for Classification). For one-hot labels and model :
is the negative log-likelihood. Minimizing MLE minimizing .
Theorem 8 (MSE for Regression). For :
Maximizing minimizing (MSE).
MLE for Neural Networks
A neural network defines a conditional distribution .
Regression: Gaussian noise MSE loss (Theorem 8).
Classification: Categorical/softmax cross-entropy loss (Theorem 7).
Language modeling: Autoregressive factorization sum of log-probabilities (negative log-likelihood per token).
Optimization. MLE is solved via Gradient Descent on — SGD on mini-batches approximates the full gradient.
Key insight. Loss function design is not separate from probabilistic modeling. Choosing a loss is choosing a likelihood.
Limitations and the Path to Bayesian Methods
-
Overfitting. With limited data, MLE can overfit (e.g., after 3/3 coin flips). Regularization and MAP estimation add prior terms.
-
No uncertainty quantification. MLE gives a point estimate; it does not provide credible intervals without asymptotic approximations.
-
Singular likelihoods. Mixture models can have unbounded likelihood (component collapses on a single point). Constraints or priors needed.
-
Model misspecification. If , MLE finds the KL-closest model, which may be misleading.
-
Finite-sample bias. MLE can be biased (variance estimation with divisor ). Unbiased alternatives exist but may have higher variance.
Progression: MLE MAP (add prior) Full Bayesian (posterior over ) — see Bayes' Theorem and Bayesian Linear Regression.
Common Pitfalls and Misconceptions
Pitfall 1: Treating likelihood as a probability over parameters. is not a posterior; it requires a prior and Bayes' theorem for that interpretation.
Pitfall 2: Assuming MLE is always unbiased. Gaussian variance MLE is biased; only asymptotic properties are guaranteed generally.
Pitfall 3: Confusing MLE with least squares in all settings. MSE is MLE only under Gaussian noise. Laplace noise L1 loss (median regression); robust losses correspond to different likelihoods.
Pitfall 4: Ignoring regularity conditions. Without identifiability, consistency fails. Mixture models without constraints have singular Fisher information.
Pitfall 5: Equating training log-likelihood with generalization. Minimizing on training data does not guarantee low KL to on test data — see Bias–Variance Tradeoff.
Research Perspective
Maximum likelihood dates to Fisher (1912–1922), who formalized it and developed asymptotic theory. The connection to KL divergence and information geometry (Amari, 1985) unified statistics and information theory.
In deep learning, MLE remains the default training objective, but research explores: noise-contrastive estimation, score matching (avoiding normalization constants), adversarial losses (non-likelihood), and Bayesian deep learning (posterior over weights). The debate over whether SGD on overparameterized networks performs implicit Bayesian inference continues.
Summary of Takeaways
- Likelihood — — Data probability as function of
- Log-likelihood — — Sum form, gradients
- MLE — — Most probable parameters
- Score — , — First-order condition
- Fisher information — — Asymptotic variance
- Consistency — — Large- correctness
- Asymptotic normality — — Confidence intervals
- MLE min KL — — Closest model to data
Next article: The Bias–Variance Tradeoff → — decomposing prediction error beyond point estimation.
Exercises
Exercise 1 (Bernoulli). Derive (11) completely, verifying the second derivative is negative at the optimum.
Exercise 2 (Gaussian). Derive (9) for both and simultaneously.
Exercise 3 (Fisher information). Compute for Bernoulli and verify the Cramér-Rao bound for .
Exercise 4 (Consistency). Explain why after three heads is consistent for the true .
Exercise 5 (Invariance). If for Poisson, what is the MLE of ?
Exercise 6 (KL). Prove Theorem 6 directly from the definition of .
Exercise 7 (Conceptual). Why does MSE correspond to Gaussian noise but not Laplace noise?
Exercise 8 (Asymptotic). State the regularity conditions needed for Theorem 3 and give an example where they fail.