Likelihood-Based Statistics¶
The Story Behind the Mathematics¶
In the early 18th century, mathematicians faced a fundamental problem: how to extract reliable information from noisy, incomplete data? Thomas Bayes, Daniel Bernoulli, and Pierre-Simon Laplace were among the first to recognize that probability could be used "in reverse" — not to predict data from known parameters, but to infer parameters from observed data.
However, it was Ronald Aylmer Fisher (1890-1962), a British geneticist and statistician, who completely revolutionized this field. In the 1920s, Fisher worked at the Rothamsted Experimental Station, analyzing agricultural data. He realized that existing statistical methods were inadequate: they lacked mathematical rigor and a unifying theory.
In his seminal 1922 paper "On the Mathematical Foundations of Theoretical Statistics," Fisher introduced three revolutionary concepts:
- The Likelihood Principle — The idea that all relevant information about parameters contained in the data is captured by the likelihood function
- Maximum Likelihood Estimation (MLE) — A systematic method for finding the "best" estimators
- Fisher Information — A measure of the precision with which a parameter can be estimated
Fisher was known for his combative character. He had famous controversies with Karl Pearson and Jerzy Neyman about the philosophy of statistical inference. While Pearson preferred the method of moments (simpler but less efficient), Fisher insisted that likelihood provided the optimal theoretical framework. History proved him right: MLE is today the most widely used parametric estimation method in nearly all scientific fields.
Why It Matters¶
Likelihood-based statistics are the foundation of modern statistical inference. They are used in:
- Machine Learning: training probabilistic models (logistic regression, neural networks, language models)
- Medicine: estimating drug efficacy rates in clinical trials
- Economics: estimating parameters in econometric models (ARIMA, GARCH)
- Physics: calibrating particle detectors and analyzing experimental data
- Biology: phylogenetic inference, genomic sequence analysis
- Finance: option pricing, volatility estimation
Without likelihood theory, we wouldn't have rigorous methods to quantify the uncertainty of our estimates or to compare competing models.
Prerequisites¶
- Basic probability concepts (random variables, distributions)
- Variance and Moments
- Differential calculus (derivatives, function maximization)
- Knowledge of the Gaussian Distribution
Fundamental Concepts¶
Before deriving formulas, we must build the conceptual building blocks from first principles.
What is Likelihood?¶
Likelihood is not a probability. This distinction is crucial and often misunderstood.
Probability: We fix the parameter \(\theta\) and ask: "How likely are we to observe different values of the data \(X\)?"
Likelihood: We fix the observed data \(x\) and ask: "How 'plausible' are different values of the parameter \(\theta\) given what we observed?"
Note: the mathematical function is the same (\(f\)), but the meaning is opposite. The likelihood \(L(\theta | x)\) is not a probability distribution for \(\theta\) — it doesn't integrate to 1 with respect to \(\theta\).
Intuitive Example: Imagine observing 8 heads in 10 coin flips. - If \(\theta = 0.5\) (fair coin), the probability of this outcome is \(\binom{10}{8}(0.5)^{10} \approx 0.044\) - If \(\theta = 0.8\) (biased coin), the same probability is \(\binom{10}{8}(0.8)^8(0.2)^2 \approx 0.302\)
Likelihood tells us: "The data are about 7 times more likely if \(\theta = 0.8\) compared to \(\theta = 0.5\)."
Likelihood for Independent Samples¶
If we have \(n\) independent and identically distributed (i.i.d.) observations \(x_1, x_2, \ldots, x_n\), the likelihood of the complete sample is the product of individual likelihoods:
Why the product? Because of independence. The joint probability of independent events is the product of individual probabilities:
The Log-Likelihood¶
In practice, we almost always work with the log-likelihood:
Why take the logarithm?
- Products → Sums: \(\ln(a \cdot b) = \ln a + \ln b\). Sums are much easier to differentiate.
- Numerical stability: Multiplying many small probabilities (e.g., \(10^{-10} \times 10^{-12}\)) causes underflow on computers. Logarithms transform these numbers into manageable sums.
- Monotonicity: Since \(\ln(x)\) is strictly increasing, maximizing \(\ell(\theta)\) is equivalent to maximizing \(L(\theta)\).
The Maximum Likelihood Estimator (MLE)¶
The maximum likelihood estimator \(\hat{\theta}_{MLE}\) is the value that maximizes the likelihood:
Interpretation: "Among all possible values of \(\theta\), which one makes the observed data most plausible?"
To find it, we use differential calculus:
- Differentiate \(\ell(\theta)\) with respect to \(\theta\)
- Set the derivative equal to zero (first-order condition)
- Solve for \(\theta\)
- Verify that it's a maximum (not a minimum or saddle point)
Complete Derivation: Normal Distribution¶
Now let's derive the MLE estimators for the most important distribution in statistics: the normal (or Gaussian).
Problem Setup¶
Suppose we have \(n\) i.i.d. observations \(x_1, x_2, \ldots, x_n\) from a normal distribution with unknown parameters \(\mu\) (mean) and \(\sigma^2\) (variance):
The probability density function (PDF) of the normal is:
Objective: Find \(\hat{\mu}\) and \(\hat{\sigma}^2\) that maximize the likelihood.
Step 1: Construct the Likelihood Function¶
For \(n\) i.i.d. observations, the likelihood is:
Substituting the PDF:
We can separate the product:
Simplifying:
Step 2: Switch to Log-Likelihood¶
Take the natural logarithm of both sides. Recall the properties of logarithms: - \(\ln(a^b) = b\ln(a)\) - \(\ln(ab) = \ln(a) + \ln(b)\) - \(\ln(e^x) = x\)
Expand further using \(\ln(ab) = \ln a + \ln b\):
Important note: The term \(-\frac{n}{2}\ln(2\pi)\) is a constant (doesn't depend on \(\mu\) or \(\sigma^2\)), so we can ignore it in maximization. We get:
Step 3: Estimate \(\mu\) (Mean)¶
To find \(\hat{\mu}\), differentiate \(\ell\) with respect to \(\mu\) and set it equal to zero.
Why differentiate? At maxima (or minima), the slope of the function is zero. We're looking for the peak of the log-likelihood curve.
The first term doesn't depend on \(\mu\), so its derivative is zero:
Calculate the derivative of the sum. Using the chain rule:
Therefore:
Set the derivative equal to zero (first-order condition):
Since \(\sigma^2 \neq 0\), we can multiply both sides by \(\sigma^2\):
Expand the sum:
The second term is \(n\mu\) (we sum \(\mu\) for \(n\) times):
Solve for \(\mu\):
Result: The MLE estimator of the mean is the sample mean \(\bar{x}\).
Interpretation: The value of \(\mu\) that makes the data most likely is exactly the average of the data. Intuitively: if the data are distributed around \(\mu\), the best estimate of \(\mu\) is the center of the observed data.
Step 4: Estimate \(\sigma^2\) (Variance)¶
Now let's find \(\hat{\sigma}^2\). Differentiate \(\ell\) with respect to \(\sigma^2\) and set it equal to zero.
Technical note: We differentiate with respect to \(\sigma^2\) (not \(\sigma\)) because it makes calculations simpler. \(\sigma^2\) is the natural parameter of the normal distribution.
Calculate the derivatives of the two terms separately.
First term: Using \(\frac{d}{dx}\ln(x) = \frac{1}{x}\):
Second term: Rewrite as \(-\frac{1}{2}(\sigma^2)^{-1}\sum(x_i-\mu)^2\). Using the power rule \(\frac{d}{dx}x^{-1} = -x^{-2}\):
Combining the two terms:
Set equal to zero:
Multiply both sides by \(2(\sigma^2)^2\) to eliminate denominators:
Solve for \(\sigma^2\):
But wait! We derived with respect to \(\sigma^2\) treating \(\mu\) as known. In reality, \(\mu\) is unknown and we must substitute it with its estimate \(\hat{\mu} = \bar{x}\):
Result: The MLE estimator of variance is the sample variance (with denominator \(n\)).
Important note on bias: This estimator is biased. Its expected value is:
To obtain an unbiased estimator, we use denominator \(n-1\) instead of \(n\):
Why this bias? When we estimate \(\mu\) with \(\bar{x}\), we "use up" one degree of freedom of the data. The sample mean \(\bar{x}\) is constructed to minimize the sum of squared deviations, so \(\sum(x_i-\bar{x})^2\) systematically underestimates \(\sum(x_i-\mu)^2\). The \(n-1\) correction compensates for this underestimation.
Summary of MLE Estimates for Normal¶
For an i.i.d. sample \(x_1, \ldots, x_n\) from \(\mathcal{N}(\mu, \sigma^2)\):
Other Examples: Exponential and Binomial Distributions¶
Exponential Distribution¶
PDF: \(f(x|\lambda) = \lambda e^{-\lambda x}\) for \(x \geq 0\), \(\lambda > 0\)
Log-likelihood:
Derivative:
Solution:
The MLE of the rate parameter is the reciprocal of the sample mean.
Binomial Distribution¶
PMF: \(P(X=k) = \binom{n}{k}p^k(1-p)^{n-k}\)
For \(m\) independent repetitions with \(k_1, \ldots, k_m\) successes:
Log-likelihood:
Derivative:
Solution:
The MLE of success probability is the empirical proportion of successes.
Properties of MLE Estimators¶
1. Consistency¶
As \(n \to \infty\), \(\hat{\theta}_{MLE} \overset{P}{\to} \theta_0\) (converges in probability to the true value).
Meaning: With enough data, MLE finds the true parameter.
2. Asymptotic Normality¶
For large \(n\):
where \(I(\theta)\) is Fisher information:
Meaning: The sampling distribution of MLE is approximately normal. This allows us to construct confidence intervals and hypothesis tests.
3. Efficiency¶
Among all unbiased estimators, MLE achieves minimum variance asymptotically (reaches the Cramér-Rao lower bound).
Meaning: No unbiased estimator has lower variance (asymptotically). MLE is "optimal" in this sense.
4. Invariance¶
If \(\hat{\theta}\) is the MLE of \(\theta\), then \(g(\hat{\theta})\) is the MLE of \(g(\theta)\) for any function \(g\).
Example: If \(\hat{\sigma}^2\) is the MLE of variance, then \(\sqrt{\hat{\sigma}^2} = \hat{\sigma}\) is the MLE of standard deviation.
Fisher Information¶
Fisher information quantifies how much "information" an observation provides about the unknown parameter.
Interpretation: - Higher \(I(\theta)\) means we can estimate \(\theta\) more precisely - The asymptotic variance of MLE is \(1/(nI(\theta))\)
Example for Normal: For \(X \sim \mathcal{N}(\mu, \sigma^2)\) with known \(\sigma^2\):
Thus \(\text{Var}(\hat{\mu}) \approx \frac{\sigma^2}{n}\), which exactly matches the variance of the sample mean.
Likelihood Ratio Tests¶
Likelihood is used not only to estimate parameters, but also to compare models and test hypotheses.
Likelihood Ratio Statistic¶
To test \(H_0: \theta \in \Theta_0\) against \(H_1: \theta \in \Theta_1\):
Under \(H_0\), for large \(n\):
where \(k\) is the difference in the number of parameters between models.
Example: Testing if a coin is fair (\(H_0: p = 0.5\)) against \(H_1: p \neq 0.5\).
Model Selection Criteria¶
AIC (Akaike Information Criterion)¶
where \(k\) is the number of parameters. Choose the model with minimum AIC.
Complexity penalty: The \(2k\) term penalizes models with too many parameters (avoids overfitting).
BIC (Bayesian Information Criterion)¶
Penalizes complexity more strongly than AIC (penalty \(k\ln n\) instead of \(2k\)).
Common Errors and Misconceptions¶
-
Likelihood ≠ Probability: \(L(\theta|x)\) is not \(P(\theta|x)\). Likelihood is not a distribution for \(\theta\).
-
MLE can be biased: As in the case of \(\hat{\sigma}^2\) for normal. Consistency ≠ unbiasedness.
-
MLE may not exist or be unique: In some pathological models, the likelihood may not have a well-defined maximum.
-
Local maxima: In complex models (e.g., mixture models), \(\ell(\theta)\) can have multiple local maxima. Numerical methods needed (EM algorithm, gradient).
-
Small samples: The optimal properties of MLE are asymptotic. For small \(n\), other estimators might perform better.
Variables and Symbols¶
| Symbol | Name | Description |
|---|---|---|
| \(\theta\) | Parameter | Unknown quantity to estimate |
| \(X_i\) | Random variable | Model for the \(i\)-th observation |
| \(x_i\) | Observation | Realized value of \(X_i\) |
| \(f(x\|\theta)\) | PDF/PMF | Density/mass function |
| \(L(\theta\|x)\) | Likelihood | Plausibility of \(\theta\) given data |
| \(\ell(\theta)\) | Log-likelihood | \(\ln L(\theta)\) |
| \(\hat{\theta}_{MLE}\) | MLE estimator | Value that maximizes \(L\) or \(\ell\) |
| \(I(\theta)\) | Fisher information | Amount of information about \(\theta\) |
| \(n\) | Sample size | Number of observations |
Related Concepts¶
- Method of Moments — Alternative estimation method
- Confidence Intervals — Constructed using asymptotic normality of MLE
- Gaussian Distribution — Most common distribution for MLE
- Variance — Estimated via MLE
- Hypothesis Testing — Based on likelihood ratio
Historical and Modern References¶
- Fisher, R. A. (1922). "On the mathematical foundations of theoretical statistics." Philosophical Transactions of the Royal Society A, 222:309-368.
- Fisher, R. A. (1925). "Theory of Statistical Estimation." Proceedings of the Cambridge Philosophical Society, 22:700-725.
- Casella, G., & Berger, R. L. (2002). Statistical Inference. Duxbury Press.
- Lehmann, E. L., & Casella, G. (1998). Theory of Point Estimation. Springer.