Lably
Skip to content

Likelihood function

Function related to statistics and probability theory

  • 22 min read
  • 6 chapters
  • 3 labs on Lably

Learn it on Lably

In maximum likelihood estimation, the model parameter(s) or argument that maximizes the likelihood function serves as a point estimate for the unknown parameter, while the Fisher information (often approximated by the likelihood's Hessian matrix at the maximum) gives an indication of the estimate's precision.

In contrast, in Bayesian statistics, the estimate of interest is the converse of the likelihood, the so-called posterior probability of the parameter given the observed data, which is calculated via Bayes' rule.

Definition

The likelihood function, parameterized by a (possibly multivariate) parameter θ, is usually defined differently for discrete and continuous probability distributions (a more general definition is discussed below). Given a probability density or mass function

x↦f(x∣θ),

where x is a realization of the random variable X, the likelihood function is θ↦f(x∣θ), often written L(θ∣x).

In other words, when f(x∣θ) is viewed as a function of x with θ fixed, it is a probability density function, and when viewed as a function of θ with x fixed, it is a likelihood function. In the frequentist paradigm, the notation f(x∣θ) is often avoided and instead f(x;θ) or f(x,θ) are used to indicate that θ is regarded as a fixed unknown quantity rather than as a random variable being conditioned on.

The likelihood function does not specify the probability that θ is the truth, given the observed sample X=x. Such an interpretation is a common error, with potentially disastrous consequences (see prosecutor's fallacy).

Discrete probability distribution

Let X be a discrete random variable with probability mass function p depending on a parameter θ. Then the function

L(θ∣x)=pθ(x)=Pθ(X=x)=Pr{X=x∣Θ=θ},

considered as a function of θ, a possible value of the deterministic but unknown parameter Θ, is the likelihood function, given the outcome x of the random variable X. Sometimes the probability of "the value x of X for the parameter value θ" is written as P(X = x | θ) or P(X = x; θ). The likelihood is the probability that a particular outcome x is observed when the true value of the parameter is θ, equivalent to the probability mass on x; it is not a probability density over the parameter θ. The likelihood, L(θ∣x), should not be confused with P(θ∣x), which is the posterior probability of θ given the data x.

Example

Consider a simple statistical model of a coin flip: a single parameter pH that expresses the "fairness" of the coin. The parameter is the probability that a coin lands heads up ("H") when tossed. pH can take on any value within the range 0.0 to 1.0. For a perfectly fair coin, pH=0.5.

Imagine flipping a fair coin twice, and observing two heads in two tosses ("HH"). Assuming that each successive coin flip is i.i.d., then the probability of observing HH is

P(HH∣pH=0.5)=0.52=0.25.

Equivalently, the likelihood of observing "HH" assuming pH=0.5 is

L(pH=0.5∣HH)=0.25.

This is not the same as saying that P(pH=0.5∣HH)=0.25, a conclusion which could only be reached via Bayes' theorem given knowledge about the marginal probabilities P(pH=0.5) and P(HH).

Now suppose that the coin is not a fair coin, but instead that pH=0.3. Then the probability of two heads on two flips is

P(HH∣pH=0.3)=0.32=0.09.

Hence

L(pH=0.3∣HH)=0.09.

More generally, for each value of pH, we can calculate the corresponding likelihood. The result of such calculations is displayed in Figure 1. The integral of L over [0, 1] is 1/3; likelihoods need not integrate or sum to one over the parameter space.

Continuous probability distribution

Let X be a random variable following an absolutely continuous probability distribution with density function f (a function of x) which depends on a parameter θ. Then the function

L(θ∣x)=fθ(x),

considered as a function of θ, is the likelihood function (of θ, given the outcome X=x). Again, L is not a probability density or mass function over θ, despite being a function of θ given the observation X=x.

Relationship between the likelihood and probability density functions

The use of the probability density in specifying the likelihood function above is justified as follows. Given an observation xj, the likelihood for the interval [xj,xj+h], where h>0 is a constant, is given by L(θ∣x∈[xj,xj+h]). Observe that argmaxθ⁡L(θ∣x∈[xj,xj+h])=argmaxθ⁡1hL(θ∣x∈[xj,xj+h]), since h is positive and constant. Because argmaxθ⁡1hL(θ∣x∈[xj,xj+h])=argmaxθ⁡1hPr(xj≤x≤xj+h∣θ)=argmaxθ⁡1h∫xjxj+hf(x∣θ)dx,

where f(x∣θ) is the probability density function, it follows that

argmaxθ⁡L(θ∣x∈[xj,xj+h])=argmaxθ⁡1h∫xjxj+hf(x∣θ)dx.

The first fundamental theorem of calculus provides that limh→0+1h∫xjxj+hf(x∣θ)dx=f(xj∣θ).

Then argmaxθ⁡L(θ∣xj)=argmaxθ⁡[limh→0+L(θ∣x∈[xj,xj+h])]=argmaxθ⁡[limh→0+1h∫xjxj+hf(x∣θ)dx]=argmaxθ⁡f(xj∣θ).

Therefore, argmaxθ⁡L(θ∣xj)=argmaxθ⁡f(xj∣θ), and so maximizing the probability density at xj amounts to maximizing the likelihood of the specific observation xj.

In general

In measure-theoretic probability theory, the density function is defined as the Radon–Nikodym derivative of the probability distribution relative to a common dominating measure. The likelihood function is this density interpreted as a function of the parameter, rather than the random variable. Thus, we can construct a likelihood function for any distribution, whether discrete, continuous, a mixture, or otherwise. (Likelihoods are comparable, e.g. for parameter estimation, only if they are Radon–Nikodym derivatives with respect to the same dominating measure.)

The above discussion of the likelihood for discrete random variables uses the counting measure, under which the probability density at any outcome equals the probability of that outcome.

Likelihoods for mixed continuous–discrete distributions

The above can be extended in a simple way to allow consideration of distributions which contain both discrete and continuous components. Suppose that the distribution consists of a number of discrete probability masses pk(θ) and a density f(x∣θ), where the sum of all the p's added to the integral of f is always one. Assuming that it is possible to distinguish an observation corresponding to one of the discrete probability masses from one which corresponds to the density component, the likelihood function for an observation from the continuous component can be dealt with in the manner shown above. For an observation from the discrete component, the likelihood function for an observation from the discrete component is simply L(θ∣x)=pk(θ), where k is the index of the discrete probability mass corresponding to observation x, because maximizing the probability mass (or probability) at x amounts to maximizing the likelihood of the specific observation.

The fact that the likelihood function can be defined in a way that includes contributions that are not commensurate (the density and the probability mass) arises from the way in which the likelihood function is defined up to a constant of proportionality, where this "constant" can change with the observation x, but not with the parameter θ.

Regularity conditions

In the context of parameter estimation, the likelihood function is usually assumed to obey certain conditions, known as regularity conditions. These conditions are assumed in various proofs involving likelihood functions, and need to be verified in each particular application. For maximum likelihood estimation, the existence of a global maximum of the likelihood function is of the utmost importance. By the extreme value theorem, it suffices that the likelihood function is continuous on a compact parameter space for the maximum likelihood estimator to exist. While the continuity assumption is usually met, the compactness assumption about the parameter space is often not, as the bounds of the true parameter values might be unknown. In that case, concavity of the likelihood function plays a key role.

More specifically, if the likelihood function is twice continuously differentiable on the k-dimensional parameter space Θ assumed to be an open connected subset of Rk, there exists a unique maximum θ^∈Θ if the matrix of second partials H(θ)≡[∂2L∂θi∂θj]i,j=1,1ni,nj is negative definite for every θ∈Θ at which the gradient ∇L≡[∂L∂θi]i=1ni vanishes, and if the likelihood function approaches a constant on the boundary of the parameter space, ∂Θ, i.e., limθ→∂ΘL(θ)=0, which may include the points at infinity if Θ is unbounded. Mäkeläinen and co-authors prove this result using Morse theory while informally appealing to a mountain pass property. Mascarenhas restates their proof using the mountain pass theorem.

In the proofs of consistency and asymptotic normality of the maximum likelihood estimator, additional assumptions are made about the probability densities that form the basis of a particular likelihood function. These conditions were first established by Chanda. In particular, for almost all x, and for all θ∈Θ, ∂log⁡f∂θr,∂2log⁡f∂θr∂θs,∂3log⁡f∂θr∂θs∂θt exist for all r,s,t=1,2,…,k in order to ensure the existence of a Taylor expansion. Second, for almost all x and for every θ∈Θ it must be that |∂f∂θr|<Fr(x),|∂2f∂θr∂θs|<Frs(x),|∂3f∂θr∂θs∂θt|<Hrst(x) where H is such that ∫−∞∞Hrst(z)dz≤M<∞. This boundedness of the derivatives is needed to allow for differentiation under the integral sign. And lastly, it is assumed that the information matrix, I(θ)=∫−∞∞∂log⁡f∂θr∂log⁡f∂θsfdz is positive definite and |I(θ)| is finite. This ensures that the score has a finite variance.

The above conditions are sufficient, but not necessary. That is, a model that does not meet these regularity conditions may or may not have a maximum likelihood estimator of the properties mentioned above. Further, in case of non-independently or non-identically distributed observations additional properties may need to be assumed.

In Bayesian statistics, almost identical regularity conditions are imposed on the likelihood function in order to proof asymptotic normality of the posterior probability, and therefore to justify a Laplace approximation of the posterior in large samples.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Functions