Algorithm Search⌘K

Definitionintro

Likelihood function

Also called likelihood.

The probability or density of the observed data, viewed as a function of the parameter with the data held fixed. Its logarithm is the log-likelihood.

The likelihood function of a statistical model is the probability, or the density, of the data that were actually observed, read as a function of the parameter. The data are held fixed and the parameter varies. It measures how well each parameter value accounts for the observations, and it is the common input of maximum likelihood estimation, the score function, the likelihood ratio test and Bayesian inference. It is not a probability distribution over the parameter.

Definition

Let a model give the data XX the density or mass function f(x;θ)f(x; \theta), θ∈Θ\theta \in \Theta, with respect to one fixed measure (counting measure for discrete data, Lebesgue measure for continuous data). For an observed value xx, the likelihood function is the map

L(θ;x)=f(x;θ),θ∈Θ.L(\theta; x) = f(x; \theta), \qquad \theta \in \Theta.

The log-likelihood is ℓ(θ;x)=log⁡L(θ;x)\ell(\theta; x) = \log L(\theta; x), with ℓ=−∞\ell = -\infty where L=0L = 0.

Independent data. If x=(x1,…,xn)x = (x_1, \ldots, x_n) are observations of independent XiX_i with densities fi(xi;θ)f_i(x_i; \theta), then

L(θ;x)=∏i=1nfi(xi;θ),ℓ(θ;x)=∑i=1nlog⁡fi(xi;θ).L(\theta; x) = \prod_{i=1}^n f_i(x_i; \theta), \qquad \ell(\theta; x) = \sum_{i=1}^n \log f_i(x_i; \theta).

For iid data all fif_i equal ff.

Defined up to a factor. Two likelihood functions L1(⋅;x)L_1(\cdot; x) and L2(⋅;y)L_2(\cdot; y) on the same Θ\Theta carry the same information about θ\theta if L1(θ;x)=c L2(θ;y)L_1(\theta; x) = c\, L_2(\theta; y) for all θ\theta, with c>0c > 0 free of θ\theta. Only ratios L(θ1;x)/L(θ2;x)L(\theta_1; x)/L(\theta_2; x) have meaning, which is why a change of the dominating measure, or a one-to-one change of the data such as a change of units, does not matter: both multiply LL by a factor free of θ\theta. Constant factors such as binomial coefficients and (2π)−n/2(2\pi)^{-n/2} are often dropped.

What it is not. L(⋅;x)L(\cdot; x) is not a density in θ\theta:

  1. Its integral over Θ\Theta need not be 1, and need not be finite.
  2. Under a one-to-one reparametrization η=g(θ)\eta = g(\theta), the likelihood function of η\eta is L(g−1(η);x)L(g^{-1}(\eta); x), with no Jacobian factor. A density in θ\theta would pick up ∣dg−1/dη∣\lvert d g^{-1}/d\eta \rvert. So the point that maximizes LL moves with gg, η^=g(θ^)\hat\eta = g(\hat\theta), while the mode of a density does not in general.
  3. A statement such as "θ\theta is in AA with likelihood 0.3" has no meaning. Turning LL into a distribution over θ\theta needs a prior, through Bayes' theorem: the posterior is proportional to the prior times LL.

Relative likelihood. When LL has a finite maximum L(θ^;x)>0L(\hat\theta; x) > 0, the relative likelihood R(θ)=L(θ;x)/L(θ^;x)R(\theta) = L(\theta; x)/L(\hat\theta; x) lies in [0,1][0, 1] and is free of the constant factor.

The likelihood principle. It states: if two experiments about the same θ\theta give data xx and yy whose likelihood functions are proportional, then the evidence about θ\theta from xx and from yy is the same. Birnbaum (1962) proved that it follows from two principles that most statisticians accept, the sufficiency principle and a conditionality principle (Casella and Berger, Section 6.3.2). Bayesian inference and pure likelihood methods obey it. Methods that use the sampling distribution, such as p-values and unbiasedness, depend on outcomes that were not observed and can violate it, as the second example below shows. Birnbaum's argument and its consequences are still debated; this page states the principle and does not take a side.

Examples and non-examples

Bernoulli data. Five iid Bernoulli(p)(p) trials give 3 successes, in the order (1,0,1,1,0)(1, 0, 1, 1, 0). Then

L(p)=p3(1−p)2,ℓ(p)=3log⁡p+2log⁡(1−p),0≤p≤1.L(p) = p^3 (1 - p)^2, \qquad \ell(p) = 3 \log p + 2 \log(1 - p), \qquad 0 \le p \le 1.

ℓ′(p)=3/p−2/(1−p)=0\ell'(p) = 3/p - 2/(1-p) = 0 gives the maximum at p^=3/5\hat p = 3/5, where L=0.63⋅0.42=0.03456L = 0.6^3 \cdot 0.4^2 = 0.03456. At p=1/2p = 1/2, L=0.03125L = 0.03125, so p=0.6p = 0.6 explains the data 0.03456/0.03125=1.105920.03456/0.03125 = 1.10592 times better than p=0.5p = 0.5, which is weak evidence. If only the count 3 is recorded, L(p)=(53)p3(1−p)2L(p) = \binom{5}{3} p^3 (1-p)^2: a constant factor of 10, the same information.

The integral is ∫01p3(1−p)2 dp=B(4,3)=3! 2!/6!=1/60\int_0^1 p^3 (1-p)^2 \, dp = B(4, 3) = 3!\,2!/6! = 1/60, not 1, which shows item 1 above. In terms of the odds η=p/(1−p)\eta = p/(1-p), L=η3/(1+η)5L = \eta^3/(1+\eta)^5, maximized at η=1.5=0.6/0.4\eta = 1.5 = 0.6/0.4, as item 2 says.

Proportional likelihoods, different p-values. Lindley and Phillips (1976) took 9 heads and 3 tails and the null value p=1/2p = 1/2 for the head probability, against p>1/2p > 1/2.

  • If the plan was 12 tosses, the count of heads is Binomial(12,p)(12, p) and L(p)=(129)p9(1−p)3L(p) = \binom{12}{9} p^9 (1-p)^3. The one-sided p-value is P(heads≥9)=(220+66+12+1)/4096=299/4096=0.0730P(\text{heads} \ge 9) = (220 + 66 + 12 + 1)/4096 = 299/4096 = 0.0730.
  • If the plan was to toss until the third tail, the count of heads is negative binomial and L(p)=(119)p9(1−p)3L(p) = \binom{11}{9} p^9 (1-p)^3. The p-value is P(heads≥9)=67/2048=0.0327P(\text{heads} \ge 9) = 67/2048 = 0.0327.

The two likelihood functions differ by the factor 220/55=4220/55 = 4, so the likelihood principle says the evidence is the same. The p-values differ, and only the second is below 0.05, because they add up the probabilities of outcomes that did not happen, and those depend on the stopping rule.

Normal data. For iid N(μ,σ2)N(\mu, \sigma^2) data, by the second equal form on sample variance,

ℓ(μ,σ2)=−n2log⁡(2πσ2)−SS+n(xˉ−μ)22σ2,SS=∑i(xi−xˉ)2.\ell(\mu, \sigma^2) = -\frac n2 \log(2\pi\sigma^2) - \frac{\mathrm{SS} + n(\bar x - \mu)^2}{2\sigma^2}, \qquad \mathrm{SS} = \sum_i (x_i - \bar x)^2.

It depends on the data only through (xˉ,SS)(\bar x, \mathrm{SS}), which is a sufficient statistic. For x=(3,7,7,9,14)x = (3, 7, 7, 9, 14), xˉ=8\bar x = 8 and SS=64\mathrm{SS} = 64, and ℓ\ell is largest at μ=8\mu = 8, σ2=64/5=12.8\sigma^2 = 64/5 = 12.8, the divisor-nn variance σ^2\hat\sigma^2.

A discontinuous likelihood function. For iid Uniform(0,θ)(0, \theta) data, f(x;θ)=θ−1f(x; \theta) = \theta^{-1} for 0≤x≤θ0 \le x \le \theta, so

L(θ)=θ−n for θ≥max⁡ixi,L(θ)=0 for θ<max⁡ixi.L(\theta) = \theta^{-n} \text{ for } \theta \ge \max_i x_i, \qquad L(\theta) = 0 \text{ for } \theta < \max_i x_i.

For the data above, L(θ)=θ−5L(\theta) = \theta^{-5} for θ≥14\theta \ge 14 and 0 below. It jumps at 14, is largest there, and has no zero derivative, so the score equation does not find the maximum.

Censored data. If a lifetime is only known to exceed cc, its factor in LL is Pθ(X>c)P_\theta(X > c), not a density value. Factors of different kinds may be multiplied as long as each is taken with respect to its own fixed measure, since the measures do not depend on θ\theta.

Non-example: the density at a fixed parameter. x↦f(x;θ0)x \mapsto f(x; \theta_0) for a fixed θ0\theta_0 is the model density, not the likelihood function. The two are the same formula read in two directions.

Non-example: a product in floating point. The product ∏if(xi;θ)\prod_i f(x_i; \theta) of 1000 density values near 10−310^{-3} is about 10−300010^{-3000}, far below the smallest positive double, about 4.9×10−3244.9 \times 10^{-324}, so it rounds to 0 for every θ\theta. Work with ℓ\ell, a sum of logs, and with differences of ℓ\ell instead of ratios of LL.

  • Maximum likelihood estimation: choose θ^\hat\theta to maximize L(θ;x)L(\theta; x); that page has its properties and failures.
  • Score function: the gradient of ℓ\ell in θ\theta; its variance is the Fisher information, see Fisher information matrix.
  • Sufficient statistic: TT is sufficient exactly when L(θ;x)L(\theta; x) depends on xx only through T(x)T(x), up to a factor free of θ\theta.
  • Likelihood ratio test: compares the maximum of LL over a null set with its maximum over Θ\Theta.
  • Marginal likelihood: the integral of LL against a prior, the normalizing constant of the posterior; it is a number for each model, not a function of θ\theta.
  • Method of moments: an estimator that does not use the likelihood function.

References

  1. George Casella and Roger L. Berger, Statistical Inference, second edition, Duxbury, 2002, Section 6.3.1 (the likelihood function) and Section 6.3.2 (the formal likelihood principle and Birnbaum's theorem)
  2. R. A. Fisher, On the mathematical foundations of theoretical statistics, Philosophical Transactions of the Royal Society A 222, 1922, pp. 309 to 368 (the likelihood of a parameter value and its distinction from a probability)
  3. Allan Birnbaum, On the foundations of statistical inference, Journal of the American Statistical Association 57(298), 1962, pp. 269 to 306 (sufficiency and conditionality imply the likelihood principle)
  4. D. V. Lindley and L. D. Phillips, Inference for a Bernoulli process (a Bayesian view), The American Statistician 30(3), 1976, pp. 112 to 119 (9 heads and 3 tails under a binomial and a negative binomial stopping rule)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/T1231X/text.yaml