Skip to content
mlmentorship

Maximum likelihood estimation

The dominant statistical principle: pick parameters that make the observed data most probable. Reduces to minimizing cross-entropy for classification and MSE for Gaussian regression.

Published · 4 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

Read a likelihood curve as a score over candidate parameter values for fixed observations, and identify the Bernoulli MLE at the observed success fraction.

Preparing the visual…

Summary

For a parametric family and observed data , the maximum likelihood estimate (MLE) is

MLE underlies almost every modern ML loss function:

  • Cross-entropy for classification = MLE under a categorical model.
  • Mean-squared error = MLE under a Gaussian noise model.
  • Negative log-likelihood for language models = MLE.

When you read “minimize the negative log-likelihood,” you’re reading MLE.

Learning objective

Read likelihood as a score over candidate parameters, not as a probability distribution over them

Bernoulli likelihood across candidate success probabilities An original diagram starts with ten fixed Bernoulli observations: seven ones and three zeros. For each candidate success probability p, the likelihood is p to the seventh power times one minus p to the third power. A solid relative-likelihood curve rises from zero, reaches its unique maximum at p equals seven tenths, the observed fraction of successes, then returns to zero. A vertical guide and labelled point identify the maximum likelihood estimate. The curve is a score as p varies and is not a probability distribution over p. fixed observations D 1 1 1 1 1 1 1 0 0 0 candidate p → L(p; D) = p⁷(1 − p)³ maximum at p̂ = 7 / 10 = 0.7 1 0.5 0 0 0.5 0.7 1 relative likelihood candidate success probability p
Read it this way: keep the ten observations fixed and move along the horizontal axis to try different values of p. Seven ones contribute p⁷; three zeros contribute (1 − p)³. Their product is largest at p = 0.7, so that candidate is the MLE. The curve compares parameter values; it is not a probability distribution over p.

Properties

Under regularity conditions (smooth log-likelihood, identifiable model, true parameter in interior), MLE is:

  • Consistent: as .
  • Asymptotically normal: where is the Fisher information.
  • Asymptotically efficient: achieves the Cramér–Rao lower bound. No consistent estimator has lower asymptotic variance.

Common cases

ModelMLE solution
Gaussian mean (known )
Gaussian variance (biased; sample-variance uses )
Bernoulli ()
Categoricalempirical class frequencies
Linear regression with Gaussian noiseOLS:
Logistic regressionno closed form; iterative (Newton, gradient methods)

Connection to cross-entropy and KL

For categorical and empirical distribution , the negative log-likelihood divided by is

Maximizing likelihood = minimizing cross-entropy = minimizing KL from the empirical distribution to the model.

MLE vs MAP

MAP (maximum a posteriori) adds a prior: . MAP equals MLE when the prior is uniform (improper). Common choices:

  • Gaussian prior L2 regularization on .
  • Laplace prior L1 regularization.

Common pitfalls

  • Treating sample variance as MLE. MLE for Gaussian variance divides by (biased); the sample variance divides by (unbiased). Different estimators.
  • Stopping at MLE without checking identifiability. If two parameter values yield identical likelihoods, MLE is non-unique.
  • Trusting MLE on small samples. Asymptotic guarantees can be misleading when is small relative to dimension; use cross-validation or Bayesian methods.
  • Forgetting that MLE on a misspecified model is still well-defined. It converges to the parameter that minimizes KL to the (mismatched) true distribution within the model family.