Maximum Likelihood
Likelihood Β· Log-Likelihood Β· MLE Β· Normal Β· Poisson Β· Bernoulli
Β© Dr. Rainer DΓΌsing Β· Interactive Tools by Claude
Maximum Likelihood β€” which parameter makes the observed data most plausible?  Β·  Likelihood β‰  Probability
Stages – Please pick a stage: ↓
Stage 1
Observation 1 β€” density f(y|ΞΌ) at fixed ΞΌ
Data point y (observed, fixed) β€”
Distribution centered at ΞΌ β€”
Density value = Likelihood L(ΞΌ|y) β€”
Observation 2 β€” likelihood L(ΞΌ|y) over ΞΌ
Maximum at ΞΌ = β€” (= y)
Log-Likelihood β„“(ΞΌ|y) β€”
The right curve shows for every possible ΞΌ, how high the density function would be at data point y. The maximum is exactly at ΞΌ = y. That is MLE for one data point.
Οƒ = 1.0 (fixed)
β‘  Data point y 1.5
β‘‘ Slide distribution: ΞΌ -2.00
Next question: What happens with multiple observations?
One data point is understood β€” next we extend the idea to several measurements and multiply the likelihood.
Concepts What you learn here
Likelihood β‰  Probability β€” the central distinction
  • P(y | ΞΈ): Probability of data y when parameter ΞΈ is known. ΞΈ fixed, y unknown.
  • L(ΞΈ | y): Likelihood of parameter ΞΈ when data y are observed. y fixed, ΞΈ unknown.

Same mathematical formula β€” completely different interpretation.

Likelihood does not sum to 1 and is not a probability over ΞΈ. For continuous distributions L is the density value β€” which can exceed 1 (set Οƒ very small in Stage 2 to see the density curve rise above 1).

Why Log-Likelihood? β€” Stage 1 & 2

The likelihood of n observations is the product of individual densities: L(ΞΈ|y₁…yβ‚™) = ∏ᡒ f(yα΅’|ΞΈ)

With many small values (e.g. 0.04 Γ— 0.09 Γ— … Γ— 0.06) the product becomes extremely small β€” numerical underflow. Stage 2 shows this live: the product of the red lines is displayed in the info text and shrinks rapidly.

The logarithm converts the product into a sum: β„“(ΞΈ) = Ξ£α΅’ log f(yα΅’|ΞΈ) β€” it is a monotonically increasing function, so the maximum lies at exactly the same point ΞΈ whether you maximize L(ΞΈ) or β„“(ΞΈ).

The key practical advantage: instead of multiplying thousands of tiny numbers together (numerical underflow β€” the computer simply returns 0), you now add manageable negative numbers, with no loss of precision. MLE therefore always maximizes β„“(ΞΈ) = log L(ΞΈ).

MLE β€” the principle & estimators β€” Stage 1 & 2

Maximum Likelihood Estimation finds ΞΈ that makes the observed data most plausible: ΞΈ = argmax β„“(ΞΈ|y)

This is not a verdict about ΞΈ itself β€” only about its compatibility with the data. Other ΞΈ values are not impossible, just less plausible.

Analytical MLE estimators (Normal): ΞΌ = y    σ² = Ξ£(yα΅’βˆ’y)Β²/n

Why is σ² biased? The estimator centers on y itself, and y is, by construction, exactly the value that minimizes Ξ£(yα΅’βˆ’c)Β² over all possible c (the least-squares property of the mean). That makes Ξ£(yα΅’βˆ’y)Β² smaller on average than Ξ£(yα΅’βˆ’ΞΌ)Β² with the true ΞΌ. Exactly: E[σ²] = (nβˆ’1)/n Β· σ² β€” the effect is strongest for small n. The unbiased estimator sΒ² = Ξ£(yα΅’βˆ’y)Β²/(nβˆ’1) corrects for this (Bessel's correction) β€” that's why R's var() divides by nβˆ’1.

In Stage 1: ΞΌ = y (one point). In Stage 2: ΞΌ = y (all points).

Multidimensional MLE: ΞΌ and Οƒ simultaneously β€” Stage 2

MLE can estimate multiple parameters simultaneously β€” a key advantage over simple moment estimators.

For the Normal distribution there are two unknown parameters: ΞΌ (location) and Οƒ (spread). The log-likelihood becomes a surface over the (ΞΌ, Οƒ)-space β€” a mountain landscape instead of a curve. The joint MLE lies at the peak: ΞΌ = y    Οƒ = √(Ξ£(yα΅’βˆ’y)Β²/n)

In Stage 2: activate "Vary Οƒ too" β†’ the heatmap shows the 2D landscape, the bright spot is the joint peak. This principle scales to arbitrarily many parameters β€” this is how lm() and glm() in R work internally.

MLE is general β€” Poisson & Bernoulli β€” Stage 3

MLE works for any parametric family β€” not just Normal. This is the foundation of GLMs:

  • Poisson (training hours/week): Ξ» = y  |  Log-likelihood: Ξ£α΅’ [yα΅’Β·log(Ξ») βˆ’ Ξ»]
  • Bernoulli (min. performance 0/1): p = proportion of ones  |  Log-likelihood: Ξ£α΅’ [yα΅’Β·log(p) + (1βˆ’yα΅’)Β·log(1βˆ’p)]

Switch between families in Stage 3: the likelihood landscape changes its shape β€” parabola for Bernoulli, asymmetric for Poisson β€” but the mechanism is identical: find the peak.

Model comparison with AIC & BIC β€” Stage 3

The maximized log-likelihood value β„“Μ‚ can be used directly for model comparison:

  • AIC = βˆ’2Β·β„“Μ‚ + 2k  (k = number of parameters)
  • BIC = βˆ’2Β·β„“Μ‚ + kΒ·log(n)

Smaller AIC/BIC = better fit at equal complexity. AIC penalizes less strongly than BIC β€” with large n, BIC favors more parsimonious models.

Important caveat: AIC/BIC are directly comparable only between models of the same distributional class β€” e.g. several count-data models (Poisson vs. Negative-Binomial) or several normal models. Between fundamentally different families (e.g. Bernoulli vs. Normal), the values are not comparable without further adjustment, since they rest on different data scales/likelihood normalizations.

Application example: Does Poisson or Negative-Binomial fit the training-hours data better? Same data, same distributional class (count data) β€” here AIC/BIC decide. In Stage 3, both are computed live.

β„Ή Maximum Likelihood β€” Help
What will I learn here?
This tool explains Maximum Likelihood Estimation (MLE) β€” one of the most important estimation mechanisms in statistics. And it makes a crucial distinction clear: likelihood is not probability.
The three stages
Likelihood β‰  Probability
Probability: Parameters fixed β†’ how probable are these data?
Likelihood: Data fixed, observed β†’ how plausible is this parameter?

Likelihood is not a probability distribution over the parameter β€” it does not integrate to 1. Only a prior turns it into a posterior (Bayes theorem).
Why this matters for Bayes
MLE delivers the most plausible parameter without prior information. Bayesian estimation weights this likelihood with a prior: Posterior ∝ Likelihood Γ— Prior. With a flat prior β†’ posterior mode β‰ˆ MLE. This makes MLE the conceptual foundation for everything that follows.
Next β†’ From LM to GLM: link functions and why GLMs apply the same MLE logic to other distributions
Further Reading
Dunn & Smyth (2018) β€” Generalized Linear Models with Examples in R