Likelihood Function
The likelihood function: construction, interpretation and proportionality
The same formula, read the other way round
Start from the joint probability model for a sample. If X1,…,Xn are independent with common probability mass or density function f(x∣θ), the joint model is
f(x1,…,xn∣θ)=∏i=1nf(xi∣θ)
Read as a function of the data with θ fixed, this is a probability distribution: it is non-negative and it sums or integrates to 1 over the sample space. The likelihood function is the very same expression read the other way round, the data are fixed at the values actually observed, and θ is the argument:
L(θ)=∏i=1nf(xi∣θ),θ∈Θ
No new formula has appeared. What has changed is which symbol is the variable, and that change is the whole idea.
L(θ) answers the question: what joint probability mass or density value would the model assign to the data I actually saw, had the parameter been θ? Comparing L at two candidate values compares how well each explains the observations.
Three properties that are easy to get wrong
- The likelihood is not a probability distribution over θ. It is not required that ∫ΘL(θ)dθ=1. For example, observing x=0 from a Poisson(λ) model gives L(λ)=e−λ, and ∫0∞e−λdλ=1; this incidental normalization does not make L a probability distribution over λ. L(0.3)=0.002 does not mean the parameter has probability 0.002 of being 0.3. Turning a likelihood into a distribution over θ requires a prior and Bayes' theorem, which is a different framework with an additional ingredient.
- The likelihood matters only up to a positive multiplicative constant. Any factor that does not involve θ cancels out of every comparison, so L(θ) and cL(θ) carry identical information about θ. This is why binomial coefficients and Poisson factorials are routinely dropped, and why writing L(θ)∝θs(1−θ)n−s is perfectly rigorous.
- The likelihood is a function, not a number. ‘The likelihood’ of a model is the whole curve over Θ. Reporting a single value is reporting the curve at one point.
The log-likelihood
Products of many small numbers underflow and are awkward to manipulate, so one almost always works with
ℓ(θ)=lnL(θ)=∑i=1nlnf(xi∣θ)
Because ln is strictly increasing, ℓ orders candidate parameter values exactly as L does: if ℓ(θ1)>ℓ(θ2) then L(θ1)>L(θ2). Multiplicative constants in L become additive constants in ℓ, so a log-likelihood is likewise defined only up to an added constant, and phrases like ‘up to an additive constant’ signal that such terms have been discarded.
A difference of log-likelihoods is the logarithm of a likelihood ratio, ℓ(θ1)−ℓ(θ2)=ln(L(θ1)/L(θ2)). Likelihood ratios and log-likelihood differences compare candidate values; the maximizing parameter value and relative shape of the curve are also meaningful. Absolute likelihood magnitudes depend on scaling.
Building a likelihood: the recipe
- Write the pmf or pdf for one observation, keeping θ symbolic.
- Write the joint pmf or pdf; under independence, form it by multiplying the individual contributions.
- Substitute the observed numbers, so that only θ remains free.
- Collect the data into sufficient summaries where possible, a count of successes, a sum, a sum of squares.
- Take logarithms and drop any term free of θ, if a log-likelihood is wanted.
Worked example: Bernoulli data
Ten independent trials with success probability p yield 7 successes and 3 failures. Each success contributes a factor p and each failure a factor 1−p, so
L(p)=p7(1−p)3,ℓ(p)=7lnp+3ln(1−p)
Evaluate at two candidates. At p=0.5: L=0.510=9.766×10−4. At p=0.7: L=0.77(0.3)3=0.082354×0.027=2.2236×10−3.
The ratio is L(0.7)/L(0.5)=2.2236×10−3/9.766×10−4=2.277. The data are about 2.3 times more probable under p=0.7 than under p=0.5, so p=0.7 is better supported, but note what this does not say.
It does not say p=0.7 is 2.3 times as likely to be true, and it does not identify the best-supported value in the whole parameter space.
Finding that maximiser is the subject of maximum likelihood estimation; constructing and reading the function is the subject here.
Had the binomial coefficient (710)=120 been included, both values would be multiplied by 120 and the ratio 2.277 would be unchanged. That is the proportionality property in action.
Worked example: a continuous model
For n independent Exponential(θ) observations, parameterised by rate so that f(x∣θ)=θe−θx for x>0,
L(θ)=∏i=1nθe−θxi=θne−θ∑xi,ℓ(θ)=nlnθ−θ∑xi
The data enter only through n and ∑xi. For continuous models L(θ) is built from densities, so its values are not probabilities and may exceed 1; multiplying the likelihood by a positive scale changes its absolute magnitude but leaves likelihood ratios and the maximizing parameter unchanged.
Twelve independent Bernoulli trials, each with success probability p, produce 5 successes. The likelihood function for these data is
L(p)=p5(1−p)7
Evaluate L(0.4). Give your answer to at least three significant figures.
Give your answer as a number.
Four independent observations are drawn from a Poisson distribution with mean λ, giving the counts 3,1,4,2. Recall that the Poisson pmf is f(x∣λ)=e−λλx/x!.
Write the log-likelihood up to an additive constant that does not involve λ. Then, using the representative obtained by dropping all terms independent of λ (equivalently, setting the additive constant to zero), evaluate it at λ=2.
Give your answer in log-likelihood units.