Likelihood &
Score Function
Master the foundations of likelihood, log-likelihood, and the score function: the essential tools that connect data to parameters in statistical inference.
What Is the Likelihood Function?
Given observed data \( x_1, x_2, \ldots, x_n \) from a distribution with density (or mass) \( f(x \mid \theta) \), the likelihood function treats the joint density as a function of the parameter \( \theta \) with the data held fixed:
Key insight: the likelihood is not a probability distribution over \( \theta \). It maps each candidate parameter value to how "compatible" it is with the observed data.
Likelihood vs Probability
Why Use the Log-Likelihood?
Products of many small probabilities can underflow numerically and are algebraically unwieldy. Taking the natural log converts the product into a sum:
Visualizing \( \ell(\theta) \)
Consider \( X_1, \ldots, X_5 \sim \text{Bernoulli}(p) \) with observed data \( \mathbf{x} = (1,1,0,1,0) \). The log-likelihood is \( \ell(p) = 3\ln p + 2\ln(1-p) \).
The Score Function
The score function is the gradient of the log-likelihood with respect to \( \theta \). It measures the sensitivity of the log-likelihood to changes in the parameter:
Equivalently, for a single observation:
Key Property: \( E[S(\theta_0)] = 0 \)
Under regularity conditions (interchange of differentiation and integration), the score evaluated at the true parameter \( \theta_0 \) has expected value zero:
Fisher Information from the Score
Since \( E[S(\theta_0)] = 0 \), the variance of the score defines the Fisher information:
Under regularity conditions, this is equivalently:
Fisher information quantifies how much curvature the log-likelihood has at \( \theta \): more curvature means more information, hence more precise estimation.
Finding the MLE: \( S(\hat{\theta}) = 0 \)
At the maximum of the log-likelihood, the slope is zero. The MLE satisfies the score equation:
Likelihood vs Posterior
| Likelihood \( L(\theta \mid \mathbf{x}) \) | Posterior \( p(\theta \mid \mathbf{x}) \) | |
|---|---|---|
| Framework | Frequentist | Bayesian |
| Requires prior? | No | Yes: \( \pi(\theta) \) |
| Integrates to 1? | No | Yes |
| Interpretation | Relative plausibility | Probability of \( \theta \) |
| Connection | Posterior \( \propto \) Likelihood \( \times \) Prior | |
How to Find the MLE: Step by Step
Example 1: Normal Mean
Let \( X_1, \ldots, X_n \sim N(\mu, \sigma^2) \) with \( \sigma^2 \) known. Find the MLE of \( \mu \).
Example 2: Exponential Rate
Let \( X_1, \ldots, X_n \sim \text{Exp}(\lambda) \) with density \( f(x \mid \lambda) = \lambda e^{-\lambda x} \) for \( x \geq 0 \).
Example 3: Poisson Parameter
Let \( X_1, \ldots, X_n \sim \text{Poisson}(\lambda) \) with \( P(X=k) = \frac{\lambda^k e^{-\lambda}}{k!} \).
Common Mistakes
Summary of Key Concepts
| Concept | Definition | Key Property |
|---|---|---|
| Likelihood | \( L(\theta) = \prod f(x_i \mid \theta) \) | Function of \( \theta \), not a density |
| Log-Likelihood | \( \ell(\theta) = \sum \ln f(x_i \mid \theta) \) | Same argmax as \( L \) |
| Score | \( S(\theta) = \ell'(\theta) \) | \( E[S(\theta_0)] = 0 \) |
| Fisher Info | \( \mathcal{I}(\theta) = \text{Var}[S(\theta)] \) | \( = -E[\ell''(\theta)] \) |
| MLE | \( \hat{\theta} \): maximizer of \( \ell \) | \( S(\hat{\theta}) = 0 \) |
Question 1 of 5
Which of the following best describes the likelihood function \( L(\theta \mid \mathbf{x}) \)?
Question 2 of 5
For \( X_1, \ldots, X_n \sim \text{Exp}(\lambda) \), what is the score function \( S(\lambda) \)?
Question 3 of 5
A fundamental property of the score function at the true parameter \( \theta_0 \) is:
Question 4 of 5
The Fisher information \( \mathcal{I}(\theta) \) can be computed as:
Question 5 of 5
For \( X_1, \ldots, X_n \sim N(\mu, \sigma^2) \) with \( \sigma^2 \) known, the MLE of \( \mu \) is \( \hat{\mu} = \bar{X} \). What is the Fisher information for a sample of size \( n \)?