01 / 21

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.

Statistics Mathematical Statistics

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

Probability
Fix \( \theta \), vary data \( x \). Answers: "How likely is this data given the parameter?" Integrates/sums to 1 over sample space.
Likelihood
Fix data \( \mathbf{x} \), vary \( \theta \). Answers: "How plausible is this parameter given the data?" Does not integrate to 1 over \( \Theta \).

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:

1
Products become sums: easier to differentiate and manipulate algebraically.
2
Numerical stability: avoids underflow when \( n \) is large.
3
Same optimum: \( \ln \) is monotone, so \( \arg\max_\theta L(\theta) = \arg\max_\theta \ell(\theta) \).

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) \).

\( p \)
\( \ell(p) \)
0 0.5 1 -12 -9 -6 -3 MLE
\( \hat{p} = 0.6 \)

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:

1
Start from: \( \int f(x \mid \theta)\, dx = 1 \) for all \( \theta \).
2
Differentiate both sides: \( \int \frac{\partial}{\partial \theta} f(x \mid \theta)\, dx = 0 \).
3
Rewrite: \( \frac{\partial}{\partial \theta} f = f \cdot \frac{\partial \ln f}{\partial \theta} \), so \( \int S(\theta) f(x \mid \theta)\, dx = E[S(\theta)] = 0 \).

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:

\( p \)
\( S(p) \)
20 10 0 -10 -20
\( \hat{p} \)
\( S(p) > 0 \): increase \( p \)
\( S(p) < 0 \): decrease \( p \)

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

1
Write the likelihood: \( L(\theta) = \prod_{i=1}^n f(x_i \mid \theta) \).
2
Take the log: \( \ell(\theta) = \sum_{i=1}^n \ln f(x_i \mid \theta) \).
3
Differentiate: compute the score \( S(\theta) = \ell'(\theta) \).
4
Set \( S(\hat{\theta}) = 0 \): solve the score equation for \( \hat{\theta} \).
5
Verify it's a max: check \( \ell''(\hat{\theta}) < 0 \) (negative curvature).

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

Treating Likelihood as Probability
\( L(\theta) \) is not a density over \( \theta \). It does not integrate to 1 and cannot be interpreted as \( P(\theta \mid \mathbf{x}) \).
Forgetting the Log
Differentiating \( L(\theta) \) directly (instead of \( \ell(\theta) \)) leads to messy product-rule expansions and frequent algebraic errors.
Ignoring Support Constraints
If the density's support depends on \( \theta \) (e.g., Uniform\((0, \theta)\)), setting \( S = 0 \) may give the wrong answer. Check boundary MLEs.
Not Verifying the Maximum
A critical point of \( \ell(\theta) \) could be a minimum or saddle point. Always confirm \( \ell''(\hat{\theta}) < 0 \).

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 \)?