Likelihood function

A likelihood function (often simply called the likelihood) measures how well a statistical model explains observed data by calculating the probability of seeing that data under different parameter values of the model. It is constructed from the joint probability distribution of the random variable that (presumably) generated the observations. When evaluated on the actual data points, it becomes a function solely of the model parameters.
In maximum likelihood estimation, the 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.
The likelihood function, parameterized by a (possibly multivariate) parameter θ {\textstyle \theta } , 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 ∣ θ ) , {\displaystyle x\mapsto f(x\mid \theta ),}
where x {\textstyle x} is a realization of the random variable X {\textstyle X} , the likelihood function is θ ↦ f ( x ∣ θ ) , {\displaystyle \theta \mapsto f(x\mid \theta ),} often written L ( θ ∣ x ) . {\displaystyle {\mathcal {L}}(\theta \mid x).}
In other words, when f ( x ∣ θ ) {\textstyle f(x\mid \theta )} is viewed as a function of x {\textstyle x} with θ {\textstyle \theta } fixed, it is a probability density function, and when viewed as a function of θ {\textstyle \theta } with x {\textstyle x} fixed, it is a likelihood function. In the frequentist paradigm, the notation f ( x ∣ θ ) {\textstyle f(x\mid \theta )} is often avoided and instead f ( x ; θ ) {\textstyle f(x;\theta )} or f ( x , θ ) {\textstyle f(x,\theta )} are used to indicate that θ {\textstyle \theta } 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 θ {\textstyle \theta } is the truth, given the observed sample X = x {\textstyle X=x} . Such an interpretation is a common error, with potentially disastrous consequences (see prosecutor's fallacy).
Let X {\textstyle X} be a discrete random variable with probability mass function p {\textstyle p} depending on a parameter θ {\textstyle \theta } . Then the function
L ( θ ∣ x ) = p θ ( x ) = P θ ( X = x ) , {\displaystyle {\mathcal {L}}(\theta \mid x)=p_{\theta }(x)=P_{\theta }(X=x),}
considered as a function of θ {\textstyle \theta } , is the likelihood function, given the outcome x {\textstyle x} of the random variable X {\textstyle X} . Sometimes the probability of "the value x {\textstyle x} of X {\textstyle X} for the parameter value θ {\textstyle \theta } " is written as P(X = x | θ) or P(X = x; θ). The likelihood is the probability that a particular outcome x {\textstyle x} is observed when the true value of the parameter is θ {\textstyle \theta } , equivalent to the probability mass on x {\textstyle x} ; it is not a probability density over the parameter θ {\textstyle \theta } . The likelihood, L ( θ ∣ x ) {\textstyle {\mathcal {L}}(\theta \mid x)} , should not be confused with P ( θ ∣ x ) {\textstyle P(\theta \mid x)} , which is the posterior probability of θ {\textstyle \theta } given the data x {\textstyle x} .
Consider a simple statistical model of a coin flip: a single parameter p H {\textstyle p_{\text{H}}} that expresses the "fairness" of the coin. The parameter is the probability that a coin lands heads up ("H") when tossed. p H {\textstyle p_{\text{H}}} can take on any value within the range 0.0 to 1.0. For a perfectly fair coin, p H = 0.5 {\textstyle p_{\text{H}}=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 ∣ p H = 0.5 ) = 0.5 2 = 0.25. {\displaystyle P({\text{HH}}\mid p_{\text{H}}=0.5)=0.5^{2}=0.25.}
Equivalently, the likelihood of observing "HH" assuming p H = 0.5 {\textstyle p_{\text{H}}=0.5} is
L ( p H = 0.5 ∣ HH ) = 0.25. {\displaystyle {\mathcal {L}}(p_{\text{H}}=0.5\mid {\text{HH}})=0.25.}
This is not the same as saying that P ( p H = 0.5 ∣ H H ) = 0.25 {\textstyle P(p_{\text{H}}=0.5\mid HH)=0.25} , a conclusion which could only be reached via Bayes' theorem given knowledge about the marginal probabilities P ( p H = 0.5 ) {\textstyle P(p_{\text{H}}=0.5)} and P ( HH ) {\textstyle P({\text{HH}})} .
Now suppose that the coin is not a fair coin, but instead that p H = 0.3 {\textstyle p_{\text{H}}=0.3} . Then the probability of two heads on two flips is
P ( HH ∣ p H = 0.3 ) = 0.3 2 = 0.09. {\displaystyle P({\text{HH}}\mid p_{\text{H}}=0.3)=0.3^{2}=0.09.}
Hence
L ( p H = 0.3 ∣ HH ) = 0.09. {\displaystyle {\mathcal {L}}(p_{\text{H}}=0.3\mid {\text{HH}})=0.09.}
More generally, for each value of p H {\textstyle p_{\text{H}}} , we can calculate the corresponding likelihood. The result of such calculations is displayed in Figure 1. The integral of L {\textstyle {\mathcal {L}}} over [0, 1] is 1/3; likelihoods need not integrate or sum to one over the parameter space.
Let X {\textstyle X} be a random variable following an absolutely continuous probability distribution with density function f {\textstyle f} (a function of x {\textstyle x} ) which depends on a parameter θ {\textstyle \theta } . Then the function
L ( θ ∣ x ) = f θ ( x ) , {\displaystyle {\mathcal {L}}(\theta \mid x)=f_{\theta }(x),}
considered as a function of θ {\textstyle \theta } , is the likelihood function (of θ {\textstyle \theta } , given the outcome X = x {\textstyle X=x} ). Again, L {\textstyle {\mathcal {L}}} is not a probability density or mass function over θ {\textstyle \theta } , despite being a function of θ {\textstyle \theta } given the observation X = x {\textstyle X=x} .
The use of the probability density in specifying the likelihood function above is justified as follows. Given an observation x j {\textstyle x_{j}} , the likelihood for the interval [ x j , x j + h ] {\textstyle [x_{j},x_{j}+h]} , where h > 0 {\textstyle h>0} is a constant, is given by L ( θ ∣ x ∈ [ x j , x j + h ] ) {\textstyle {\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h])} . Observe that a r g m a x θ ⁡ L ( θ ∣ x ∈ [ x j , x j + h ] ) = a r g m a x θ ⁡ 1 h L ( θ ∣ x ∈ [ x j , x j + h ] ) , {\displaystyle \mathop {\operatorname {arg\,max} } _{\theta }{\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h])=\mathop {\operatorname {arg\,max} } _{\theta }{\frac {1}{h}}{\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h]),} since h {\textstyle h} is positive and constant. Because a r g m a x θ ⁡ 1 h L ( θ ∣ x ∈ [ x j , x j + h ] ) = a r g m a x θ ⁡ 1 h Pr ( x j ≤ x ≤ x j + h ∣ θ ) = a r g m a x θ ⁡ 1 h ∫ x j x j + h f ( x ∣ θ ) d x , {\displaystyle \mathop {\operatorname {arg\,max} } _{\theta }{\frac {1}{h}}{\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h])=\mathop {\operatorname {arg\,max} } _{\theta }{\frac {1}{h}}\Pr(x_{j}\leq x\leq x_{j}+h\mid \theta )=\mathop {\operatorname {arg\,max} } _{\theta }{\frac {1}{h}}\int _{x_{j}}^{x_{j}+h}f(x\mid \theta )\,dx,}
where f ( x ∣ θ ) {\textstyle f(x\mid \theta )} is the probability density function, it follows that
a r g m a x θ ⁡ L ( θ ∣ x ∈ [ x j , x j + h ] ) = a r g m a x θ ⁡ 1 h ∫ x j x j + h f ( x ∣ θ ) d x . {\displaystyle \mathop {\operatorname {arg\,max} } _{\theta }{\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h])=\mathop {\operatorname {arg\,max} } _{\theta }{\frac {1}{h}}\int _{x_{j}}^{x_{j}+h}f(x\mid \theta )\,dx.}
The first fundamental theorem of calculus provides that lim h → 0 + 1 h ∫ x j x j + h f ( x ∣ θ ) d x = f ( x j ∣ θ ) . {\displaystyle \lim _{h\to 0^{+}}{\frac {1}{h}}\int _{x_{j}}^{x_{j}+h}f(x\mid \theta )\,dx=f(x_{j}\mid \theta ).}
Then a r g m a x θ ⁡ L ( θ ∣ x j ) = a r g m a x θ ⁡ [ lim h → 0 + L ( θ ∣ x ∈ [ x j , x j + h ] ) ] = a r g m a x θ ⁡ [ lim h → 0 + 1 h ∫ x j x j + h f ( x ∣ θ ) d x ] = a r g m a x θ ⁡ f ( x j ∣ θ ) . {\displaystyle {\begin{aligned}\mathop {\operatorname {arg\,max} } _{\theta }{\mathcal {L}}(\theta \mid x_{j})&=\mathop {\operatorname {arg\,max} } _{\theta }\left[\lim _{h\to 0^{+}}{\mathcal {L}}(\theta \mid x\in [x_{j},x_{j}+h])\right]\\[4pt]&=\mathop {\operatorname {arg\,max} } _{\theta }\left[\lim _{h\to 0^{+}}{\frac {1}{h}}\int _{x_{j}}^{x_{j}+h}f(x\mid \theta )\,dx\right]\\[4pt]&=\mathop {\operatorname {arg\,max} } _{\theta }f(x_{j}\mid \theta ).\end{aligned}}}
Therefore, a r g m a x θ ⁡ L ( θ ∣ x j ) = a r g m a x θ ⁡ f ( x j ∣ θ ) , {\displaystyle \mathop {\operatorname {arg\,max} } _{\theta }{\mathcal {L}}(\theta \mid x_{j})=\mathop {\operatorname {arg\,max} } _{\theta }f(x_{j}\mid \theta ),} and so maximizing the probability density at x j {\textstyle x_{j}} amounts to maximizing the likelihood of the specific observation x j {\textstyle x_{j}} .
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.
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 p k ( θ ) {\textstyle p_{k}(\theta )} and a density f ( x ∣ θ ) {\textstyle f(x\mid \theta )} , where the sum of all the p {\textstyle p} 's added to the integral of f {\textstyle 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 ) = p k ( θ ) , {\displaystyle {\mathcal {L}}(\theta \mid x)=p_{k}(\theta ),} where k {\textstyle k} is the index of the discrete probability mass corresponding to observation x {\textstyle x} , because maximizing the probability mass (or probability) at x {\textstyle 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 {\textstyle x} , but not with the parameter θ {\textstyle \theta } .
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 Θ {\textstyle \Theta } assumed to be an open connected subset of R k , {\textstyle \mathbb {R} ^{k}\,,} there exists a unique maximum θ ^ ∈ Θ {\textstyle {\hat {\theta }}\in \Theta } if the matrix of second partials H ( θ ) ≡ [ ∂ 2 L ∂ θ i ∂ θ j ] i , j = 1 , 1 n i , n j {\displaystyle \mathbf {H} (\theta )\equiv \left[\,{\frac {\partial ^{2}L}{\,\partial \theta _{i}\,\partial \theta _{j}\,}}\,\right]_{i,j=1,1}^{n_{\mathrm {i} },n_{\mathrm {j} }}\;} is negative definite for every θ ∈ Θ {\textstyle \,\theta \in \Theta \,} at which the gradient ∇ L ≡ [ ∂ L ∂ θ i ] i = 1 n i {\textstyle \;\nabla L\equiv \left[\,{\frac {\partial L}{\,\partial \theta _{i}\,}}\,\right]_{i=1}^{n_{\mathrm {i} }}\;} vanishes, and if the likelihood function approaches a constant on the boundary of the parameter space, ∂ Θ , {\textstyle \;\partial \Theta \;,} i.e., lim θ → ∂ Θ L ( θ ) = 0 , {\displaystyle \lim _{\theta \to \partial \Theta }L(\theta )=0\;,} which may include the points at infinity if Θ {\textstyle \,\Theta \,} 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 {\textstyle x} , and for all θ ∈ Θ , {\textstyle \,\theta \in \Theta \,,} ∂ log ⁡ f ∂ θ r , ∂ 2 log ⁡ f ∂ θ r ∂ θ s , ∂ 3 log ⁡ f ∂ θ r ∂ θ s ∂ θ t {\displaystyle {\frac {\partial \log f}{\partial \theta _{r}}}\,,\quad {\frac {\partial ^{2}\log f}{\partial \theta _{r}\partial \theta _{s}}}\,,\quad {\frac {\partial ^{3}\log f}{\partial \theta _{r}\,\partial \theta _{s}\,\partial \theta _{t}}}\,} exist for all r , s , t = 1 , 2 , … , k {\textstyle \,r,s,t=1,2,\ldots ,k\,} in order to ensure the existence of a Taylor expansion. Second, for almost all x {\textstyle x} and for every θ ∈ Θ {\textstyle \,\theta \in \Theta \,} it must be that | ∂ f ∂ θ r | < F r ( x ) , | ∂ 2 f ∂ θ r ∂ θ s | < F r s ( x ) , | ∂ 3 f ∂ θ r ∂ θ s ∂ θ t | < H r s t ( x ) {\displaystyle \left|{\frac {\partial f}{\partial \theta _{r}}}\right|<F_{r}(x)\,,\quad \left|{\frac {\partial ^{2}f}{\partial \theta _{r}\,\partial \theta _{s}}}\right|<F_{rs}(x)\,,\quad \left|{\frac {\partial ^{3}f}{\partial \theta _{r}\,\partial \theta _{s}\,\partial \theta _{t}}}\right|<H_{rst}(x)} where H {\textstyle H} is such that ∫ − ∞ ∞ H r s t ( z ) d z ≤ M < ∞ . {\textstyle \,\int _{-\infty }^{\infty }H_{rst}(z)\mathrm {d} z\leq M<\infty \;.} 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 ∂ θ s f d z {\displaystyle \mathbf {I} (\theta )=\int _{-\infty }^{\infty }{\frac {\partial \log f}{\partial \theta _{r}}}\ {\frac {\partial \log f}{\partial \theta _{s}}}\ f\ \mathrm {d} z} is positive definite and | I ( θ ) | {\textstyle \,\left|\mathbf {I} (\theta )\right|\,} 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.
A likelihood ratio is the ratio of any two specified likelihoods, frequently written as: Λ ( θ 1 : θ 2 ∣ x ) = L ( θ 1 ∣ x ) L ( θ 2 ∣ x ) . {\displaystyle \Lambda (\theta _{1}:\theta _{2}\mid x)={\frac {{\mathcal {L}}(\theta _{1}\mid x)}{{\mathcal {L}}(\theta _{2}\mid x)}}.}
The likelihood ratio is central to likelihoodist statistics: the law of likelihood states that the degree to which data (considered as evidence) supports one parameter value versus another is measured by the likelihood ratio.
In frequentist inference, the likelihood ratio is the basis for a test statistic, the so-called likelihood-ratio test. By the Neyman–Pearson lemma, this is the most powerful test for comparing two simple hypotheses at a given significance level. Numerous other tests can be viewed as likelihood-ratio tests or approximations thereof. The asymptotic distribution of the log-likelihood ratio, considered as a test statistic, is given by Wilks' theorem.
The likelihood ratio is also of central importance in Bayesian inference, where it is known as the Bayes factor, and is used in Bayes' rule. Stated in terms of odds, Bayes' rule states that the posterior odds of two alternatives, ⁠ A 1 {\displaystyle A_{1}} ⁠ and ⁠ A 2 {\displaystyle A_{2}} ⁠, given an event ⁠ B {\displaystyle B} ⁠, is the prior odds, times the likelihood ratio. As an equation: O ( A 1 : A 2 ∣ B ) = O ( A 1 : A 2 ) ⋅ Λ ( A 1 : A 2 ∣ B ) . {\displaystyle O(A_{1}:A_{2}\mid B)=O(A_{1}:A_{2})\cdot \Lambda (A_{1}:A_{2}\mid B).}
The likelihood ratio is not directly used in AIC-based statistics. Instead, what is used is the relative likelihood of models (see below).
In evidence-based medicine, likelihood ratios are used in diagnostic testing to assess the value of performing a diagnostic test.
Since the actual value of the likelihood function depends on the sample, it is often convenient to work with a standardized measure. Suppose that the maximum likelihood estimate for the parameter θ is θ ^ {\textstyle {\hat {\theta }}} . Relative plausibilities of other θ values may be found by comparing the likelihoods of those other values with the likelihood of θ ^ {\textstyle {\hat {\theta }}} . The relative likelihood of θ is defined to be R ( θ ) = L ( θ ∣ x ) L ( θ ^ ∣ x ) . {\displaystyle R(\theta )={\frac {{\mathcal {L}}(\theta \mid x)}{{\mathcal {L}}({\hat {\theta }}\mid x)}}.} Thus, the relative likelihood is the likelihood ratio (discussed above) with the fixed denominator L ( θ ^ ) {\textstyle {\mathcal {L}}({\hat {\theta }})} . This corresponds to standardizing the likelihood to have a maximum of 1.
A likelihood region is the set of all values of θ whose relative likelihood is greater than or equal to a given threshold. In terms of percentages, a p% likelihood region for θ is defined to be
{ θ : R ( θ ) ≥ p 100 } . {\displaystyle \left\{\theta :R(\theta )\geq {\frac {p}{100}}\right\}.}
If θ is a single real parameter, a p% likelihood region will usually comprise an interval of real values. If the region does comprise an interval, then it is called a likelihood interval.
Likelihood intervals, and more generally likelihood regions, are used for interval estimation within likelihoodist statistics: they are similar to confidence intervals in frequentist statistics and credible intervals in Bayesian statistics. Likelihood intervals are interpreted directly in terms of relative likelihood, not in terms of coverage probability (frequentism) or posterior probability (Bayesianism).
Given a model, likelihood intervals can be compared to confidence intervals. If θ is a single real parameter, then under certain conditions, a 14.65% likelihood interval (about 1:7 likelihood) for θ will be the same as a 95% confidence interval (19/20 coverage probability). In a slightly different formulation suited to the use of log-likelihoods (see Wilks' theorem), the test statistic is twice the difference in log-likelihoods and the probability distribution of the test statistic is approximately a chi-squared distribution with degrees-of-freedom (df) equal to the difference in df's between the two models (therefore, the e likelihood interval is the same as the 0.954 confidence interval; assuming difference in df's to be 1).
In many cases, the likelihood is a function of more than one parameter but interest focuses on the estimation of only one, or at most a few of them, with the others being considered as nuisance parameters. Several alternative approaches have been developed to eliminate such nuisance parameters, so that a likelihood can be written as a function of only the parameter (or parameters) of interest: the main approaches are profile, conditional, and marginal likelihoods. These approaches are also useful when a high-dimensional likelihood surface needs to be reduced to one or two parameters of interest in order to allow a graph.
It is possible to reduce the dimensions by concentrating the likelihood function for a subset of parameters by expressing the nuisance parameters as functions of the parameters of interest and replacing them in the likelihood function. In general, for a likelihood function depending on the parameter vector θ {\textstyle \mathbf {\theta } } that can be partitioned into θ = ( θ 1 : θ 2 ) {\textstyle \mathbf {\theta } =\left(\mathbf {\theta } _{1}:\mathbf {\theta } _{2}\right)} , and where a correspondence θ ^ 2 = θ ^ 2 ( θ 1 ) {\textstyle \mathbf {\hat {\theta }} _{2}=\mathbf {\hat {\theta }} _{2}\left(\mathbf {\theta } _{1}\right)} can be determined explicitly, concentration reduces computational burden of the original maximization problem.
For instance, in a linear regression with normally distributed errors, y = X β + u {\textstyle \mathbf {y} =\mathbf {X} \beta +u} , the coefficient vector could be partitioned into β = [ β 1 : β 2 ] {\textstyle \beta =\left[\beta _{1}:\beta _{2}\right]} (and consequently the design matrix X = [ X 1 : X 2 ] {\textstyle \mathbf {X} =\left[\mathbf {X} _{1}:\mathbf {X} _{2}\right]} ). Maximizing with respect to β 2 {\textstyle \beta _{2}} yields an optimal value function β 2 ( β 1 ) = ( X 2 T X 2 ) − 1 X 2 T ( y − X 1 β 1 ) {\textstyle \beta _{2}(\beta _{1})=\left(\mathbf {X} _{2}^{\mathsf {T}}\mathbf {X} _{2}\right)^{-1}\mathbf {X} _{2}^{\mathsf {T}}\left(\mathbf {y} -\mathbf {X} _{1}\beta _{1}\right)} . Using this result, the maximum likelihood estimator for β 1 {\textstyle \beta _{1}} can then be derived as β ^ 1 = ( X 1 T ( I − P 2 ) X 1 ) − 1 X 1 T ( I − P 2 ) y {\displaystyle {\hat {\beta }}_{1}=\left(\mathbf {X} _{1}^{\mathsf {T}}\left(\mathbf {I} -\mathbf {P} _{2}\right)\mathbf {X} _{1}\right)^{-1}\mathbf {X} _{1}^{\mathsf {T}}\left(\mathbf {I} -\mathbf {P} _{2}\right)\mathbf {y} } where P 2 = X 2 ( X 2 T X 2 ) − 1 X 2 T {\textstyle \mathbf {P} _{2}=\mathbf {X} _{2}\left(\mathbf {X} _{2}^{\mathsf {T}}\mathbf {X} _{2}\right)^{-1}\mathbf {X} _{2}^{\mathsf {T}}} is the projection matrix of X 2 {\textstyle \mathbf {X} _{2}} . This result is known as the Frisch–Waugh–Lovell theorem.
Since graphically the procedure of concentration is equivalent to slicing the likelihood surface along the ridge of values of the nuisance parameter β 2 {\textstyle \beta _{2}} that maximizes the likelihood function, creating an isometric profile of the likelihood function for a given β 1 {\textstyle \beta _{1}} , the result of this procedure is also known as profile likelihood. In addition to being graphed, the profile likelihood can also be used to compute confidence intervals that often have better small-sample properties than those based on asymptotic standard errors calculated from the full likelihood.
Sometimes it is possible to find a sufficient statistic for the nuisance parameters, and conditioning on this statistic results in a likelihood which does not depend on the nuisance parameters.
One example occurs in 2×2 tables, where conditioning on all four marginal totals leads to a conditional likelihood based on the non-central hypergeometric distribution. This form of conditioning is also the basis for Fisher's exact test.
Sometimes we can remove the nuisance parameters by considering a likelihood based on only part of the information in the data, for example by using the set of ranks rather than the numerical values. Another example occurs in linear mixed models, where considering a likelihood for the residuals only after fitting the fixed effects leads to residual maximum likelihood estimation of the variance components.
A partial likelihood is an adaption of the full likelihood such that only a part of the parameters (the parameters of interest) occur in it. It is a key component of the proportional hazards model: using a restriction on the hazard function, the likelihood does not contain the shape of the hazard over time.
The likelihood, given two or more independent events, is the product of the likelihoods of each of the individual events: Λ ( A ∣ X 1 ∧ X 2 ) = Λ ( A ∣ X 1 ) ⋅ Λ ( A ∣ X 2 ) . {\displaystyle \Lambda (A\mid X_{1}\land X_{2})=\Lambda (A\mid X_{1})\cdot \Lambda (A\mid X_{2}).} This follows from the definition of independence in probability: the probabilities of two independent events happening, given a model, is the product of the probabilities.
This is particularly important when the events are from independent and identically distributed random variables, such as independent observations or sampling with replacement. In such a situation, the likelihood function factors into a product of individual likelihood functions.
The empty product has value 1, which corresponds to the likelihood, given no event, being 1: before any data, the likelihood is always 1. This is similar to a uniform prior in Bayesian statistics, but in likelihoodist statistics this is not an improper prior because likelihoods are not integrated.
Log-likelihood function is the logarithm of the likelihood function, often denoted by a lowercase l or ⁠ ℓ {\displaystyle \ell } ⁠, to contrast with the uppercase L or L {\textstyle {\mathcal {L}}} for the likelihood. Because logarithms are strictly increasing functions, maximizing the likelihood is equivalent to maximizing the log-likelihood. But for practical purposes it is more convenient to work with the log-likelihood function in maximum likelihood estimation, in particular since most common probability distributions—notably the exponential family—are only logarithmically concave, and concavity of the objective function plays a key role in the maximization.
Given the independence of each event, the overall log-likelihood of intersection equals the sum of the log-likelihoods of the individual events. This is analogous to the fact that the overall log-probability is the sum of the log-probability of the individual events. In addition to the mathematical convenience from this, the adding process of log-likelihood has an intuitive interpretation, as often expressed as "support" from the data. When the parameters are estimated using the log-likelihood for the maximum likelihood estimation, each data point is used by being added to the total log-likelihood. As the data can be viewed as an evidence that support the estimated parameters, this process can be interpreted as "support from independent evidence adds", and the log-likelihood is the "weight of evidence". Interpreting negative log-probability as information content or surprisal, the support (log-likelihood) of a model, given an event, is the negative of the surprisal of the event, given the model: a model is supported by an event to the extent that the event is unsurprising, given the model.
A logarithm of a likelihood ratio is equal to the difference of the log-likelihoods: log ⁡ L ( A ) L ( B ) = log ⁡ L ( A ) − log ⁡ L ( B ) = ℓ ( A ) − ℓ ( B ) . {\displaystyle \log {\frac {{\mathcal {L}}(A)}{{\mathcal {L}}(B)}}=\log {\mathcal {L}}(A)-\log {\mathcal {L}}(B)=\ell (A)-\ell (B).}
Just as the likelihood, given no event, being 1, the log-likelihood, given no event, is 0, which corresponds to the value of the empty sum: without any data, there is no support for any models.
The graph of the log-likelihood is called the support curve (in the univariate case). In the multivariate case, the concept generalizes into a support surface over the parameter space. It has a relation to, but is distinct from, the support of a distribution.
The term was coined by A. W. F. Edwards in the context of statistical hypothesis testing, i.e. whether or not the data "support" one hypothesis (or parameter value) being tested more than any other.
The log-likelihood function being plotted is used in the computation of the score (the gradient of the log-likelihood) and Fisher information (the curvature of the log-likelihood). Thus, the graph has a direct interpretation in the context of maximum likelihood estimation and likelihood-ratio tests.
If the log-likelihood function is smooth, its gradient with respect to the parameter, known as the score and written s n ( θ ) ≡ ∇ θ ℓ n ( θ ) {\textstyle s_{n}(\theta )\equiv \nabla _{\theta }\ell _{n}(\theta )} , exists and allows for the application of differential calculus. The basic way to maximize a differentiable function is to find the stationary points (the points where the derivative is zero); since the derivative of a sum is just the sum of the derivatives, but the derivative of a product requires the product rule, it is easier to compute the stationary points of the log-likelihood of independent events than for the likelihood of independent events.
The equations defined by the stationary point of the score function serve as estimating equations for the maximum likelihood estimator. s n ( θ ) = 0 {\displaystyle s_{n}(\theta )=\mathbf {0} } In that sense, the maximum likelihood estimator is implicitly defined by the value at 0 {\textstyle \mathbf {0} } of the inverse function s n − 1 : E d → Θ {\textstyle s_{n}^{-1}:\mathbb {E} ^{d}\to \Theta } , where E d {\textstyle \mathbb {E} ^{d}} is the d-dimensional Euclidean space, and Θ {\textstyle \Theta } is the parameter space. Using the inverse function theorem, it can be shown that s n − 1 {\textstyle s_{n}^{-1}} is well-defined in an open neighborhood about 0 {\textstyle \mathbf {0} } with probability going to one, and θ ^ n = s n − 1 ( 0 ) {\textstyle {\hat {\theta }}_{n}=s_{n}^{-1}(\mathbf {0} )} is a consistent estimate of θ {\textstyle \theta } . As a consequence there exists a sequence { θ ^ n } {\textstyle \left\{{\hat {\theta }}_{n}\right\}} such that s n ( θ ^ n ) = 0 {\textstyle s_{n}({\hat {\theta }}_{n})=\mathbf {0} } asymptotically almost surely, and θ ^ n → p θ 0 {\textstyle {\hat {\theta }}_{n}\xrightarrow {\text{p}} \theta _{0}} . A similar result can be established using Rolle's theorem.
The second derivative evaluated at θ ^ {\textstyle {\hat {\theta }}} , known as Fisher information, determines the curvature of the likelihood surface, and thus indicates the precision of the estimate.
The log-likelihood is also particularly useful for exponential families of distributions, which include many of the common parametric probability distributions. The probability distribution function (and thus likelihood function) for exponential families contain products of factors involving exponentiation. The logarithm of such a function is a sum of products, again easier to differentiate than the original function.
An exponential family is one whose probability density function is of the form (for some functions, writing ⟨ − , − ⟩ {\textstyle \langle -,-\rangle } for the inner product):
p ( x ∣ θ ) = h ( x ) exp ⁡ ( ⟨ η ( θ ) , T ( x ) ⟩ − A ( θ ) ) . {\displaystyle p(x\mid {\boldsymbol {\theta }})=h(x)\exp {\Big (}\langle {\boldsymbol {\eta }}({\boldsymbol {\theta }}),\mathbf {T} (x)\rangle -A({\boldsymbol {\theta }}){\Big )}.}
Each of these terms has an interpretation, but simply switching from probability to likelihood and taking logarithms yields the sum:
ℓ ( θ ∣ x ) = ⟨ η ( θ ) , T ( x ) ⟩ − A ( θ ) + log ⁡ h ( x ) . {\displaystyle \ell ({\boldsymbol {\theta }}\mid x)=\langle {\boldsymbol {\eta }}({\boldsymbol {\theta }}),\mathbf {T} (x)\rangle -A({\boldsymbol {\theta }})+\log h(x).}
The η ( θ ) {\textstyle {\boldsymbol {\eta }}({\boldsymbol {\theta }})} and h ( x ) {\textstyle h(x)} each correspond to a change of coordinates, so in these coordinates, the log-likelihood of an exponential family is given by the simple formula:
ℓ ( η ∣ x ) = ⟨ η , T ( x ) ⟩ − A ( η ) . {\displaystyle \ell ({\boldsymbol {\eta }}\mid x)=\langle {\boldsymbol {\eta }},\mathbf {T} (x)\rangle -A({\boldsymbol {\eta }}).}
In words, the log-likelihood of an exponential family is inner product of the natural parameter ⁠ η {\displaystyle {\boldsymbol {\eta }}} ⁠ and the sufficient statistic ⁠ T ( x ) {\displaystyle \mathbf {T} (x)} ⁠, minus the normalization factor (log-partition function) ⁠ A ( η ) {\displaystyle A({\boldsymbol {\eta }})} ⁠. Thus for example the maximum likelihood estimate can be computed by taking derivatives of the sufficient statistic T and the log-partition function A.
The gamma distribution is an exponential family with two parameters, α {\textstyle \alpha } and β {\textstyle \beta } . The likelihood function is
L ( α , β ∣ x ) = β α Γ ( α ) x α − 1 e − β x . {\displaystyle {\mathcal {L}}(\alpha ,\beta \mid x)={\frac {\beta ^{\alpha }}{\Gamma (\alpha )}}x^{\alpha -1}e^{-\beta x}.}
Finding the maximum likelihood estimate of β {\textstyle \beta } for a single observed value x {\textstyle x} looks rather daunting. Its logarithm is much simpler to work with:
log ⁡ L ( α , β ∣ x ) = α log ⁡ β − log ⁡ Γ ( α ) + ( α − 1 ) log ⁡ x − β x . {\displaystyle \log {\mathcal {L}}(\alpha ,\beta \mid x)=\alpha \log \beta -\log \Gamma (\alpha )+(\alpha -1)\log x-\beta x.\,}
To maximize the log-likelihood, we first take the partial derivative with respect to β {\textstyle \beta } :
∂ log ⁡ L ( α , β ∣ x ) ∂ β = α β − x . {\displaystyle {\frac {\partial \log {\mathcal {L}}(\alpha ,\beta \mid x)}{\partial \beta }}={\frac {\alpha }{\beta }}-x.}
If there are a number of independent observations x 1 , … , x n {\textstyle x_{1},\ldots ,x_{n}} , then the joint log-likelihood will be the sum of individual log-likelihoods, and the derivative of this sum will be a sum of derivatives of each individual log-likelihood:
∂ log ⁡ L ( α , β ∣ x 1 , … , x n ) ∂ β = ∂ log ⁡ L ( α , β ∣ x 1 ) ∂ β + ⋯ + ∂ log ⁡ L ( α , β ∣ x n ) ∂ β = n α β − ∑ i = 1 n x i . {\displaystyle {\begin{aligned}&{\frac {\partial \log {\mathcal {L}}(\alpha ,\beta \mid x_{1},\ldots ,x_{n})}{\partial \beta }}\\&={\frac {\partial \log {\mathcal {L}}(\alpha ,\beta \mid x_{1})}{\partial \beta }}+\cdots +{\frac {\partial \log {\mathcal {L}}(\alpha ,\beta \mid x_{n})}{\partial \beta }}\\&={\frac {n\alpha }{\beta }}-\sum _{i=1}^{n}x_{i}.\end{aligned}}}
To complete the maximization procedure for the joint log-likelihood, the equation is set to zero and solved for β {\textstyle \beta } :
β ^ = α x ¯ . {\displaystyle {\widehat {\beta }}={\frac {\alpha }{\bar {x}}}.}
Here β ^ {\textstyle {\widehat {\beta }}} denotes the maximum-likelihood estimate, and x ¯ = 1 n ∑ i = 1 n x i {\textstyle \textstyle {\bar {x}}={\frac {1}{n}}\sum _{i=1}^{n}x_{i}} is the sample mean of the observations.
The term "likelihood" has been in use in English since at least late Middle English. Its formal use to refer to a specific function in mathematical statistics was proposed by Ronald Fisher, in two research papers published in 1921 and 1922. The 1921 paper introduced what is today called a "likelihood interval"; the 1922 paper introduced the term "method of maximum likelihood". Quoting Fisher:
The concept of likelihood should not be confused with probability as mentioned by Sir Ronald Fisher
Fisher's invention of statistical likelihood was in reaction against an earlier form of reasoning called inverse probability. His use of the term "likelihood" fixed the meaning of the term within mathematical statistics.
A. W. F. Edwards (1972) established the axiomatic basis for use of the log-likelihood ratio as a measure of relative support for one hypothesis against another. The support function is then the natural logarithm of the likelihood function. Both terms are used in phylogenetics, but were not adopted in a general treatment of the topic of statistical evidence.
Among statisticians, there is no consensus about what the foundation of statistics should be. There are four main paradigms that have been proposed for the foundation: frequentism, Bayesianism, likelihoodism, and AIC-based. For each of the proposed foundations, the interpretation of likelihood is different. The four interpretations are described in the subsections below.
In Bayesian inference, although one can speak about the likelihood of any proposition or random variable given another random variable: for example the likelihood of a parameter value or of a statistical model (see marginal likelihood), given specified data or other evidence, the likelihood function remains the same entity, with the additional interpretations of (i) a conditional density of the data given the parameter (since the parameter is then a random variable) and (ii) a measure or amount of information brought by the data about the parameter value or even the model. Due to the introduction of a probability structure on the parameter space or on the collection of models, it is possible that a parameter value or a statistical model have a large likelihood value for given data, and yet have a low probability, or vice versa. This is often the case in medical contexts. Following Bayes' Rule, the likelihood when seen as a conditional density can be multiplied by the prior probability density of the parameter and then normalized, to give a posterior probability density. More generally, the likelihood of an unknown quantity X {\textstyle X} given another unknown quantity Y {\textstyle Y} is proportional to the probability of Y {\textstyle Y} given X {\textstyle X} .
In frequentist statistics, the likelihood function is itself a statistic that summarizes a single sample from a population, whose calculated value depends on a choice of several parameters θ1 ... θp, where p is the count of parameters in some already-selected statistical model. The value of the likelihood serves as a figure of merit for the choice used for the parameters, and the parameter set with maximum likelihood is the best choice, given the data available.
The specific calculation of the likelihood is the probability that the observed sample would be assigned, assuming that the model chosen and the values of the several parameters θ give an accurate approximation of the frequency distribution of the population that the observed sample was drawn from. Heuristically, it makes sense that a good choice of parameters is those which render the sample actually observed the maximum possible post-hoc probability of having happened. Wilks' theorem quantifies the heuristic rule by showing that the difference in the logarithm of the likelihood generated by the estimate's parameter values and the logarithm of the likelihood generated by population's "true" (but unknown) parameter values is asymptotically χ distributed.
Each independent sample's maximum likelihood estimate is a separate estimate of the "true" parameter set describing the population sampled. Successive estimates from many independent samples will cluster together with the population's "true" set of parameter values hidden somewhere in their midst. The difference in the logarithms of the maximum likelihood and adjacent parameter sets' likelihoods may be used to draw a confidence region on a plot whose co-ordinates are the parameters θ1 ... θp. The region surrounds the maximum-likelihood estimate, and all points (parameter sets) within that region differ at most in log-likelihood by some fixed value. The χ distribution given by Wilks' theorem converts the region's log-likelihood differences into the "confidence" that the population's "true" parameter set lies inside. The art of choosing the fixed log-likelihood difference is to make the confidence acceptably high while keeping the region acceptably small (narrow range of estimates).
As more data are observed, instead of being used to make independent estimates, they can be combined with the previous samples to make a single combined sample, and that large sample may be used for a new maximum likelihood estimate. As the size of the combined sample increases, the size of the likelihood region with the same confidence shrinks. Eventually, either the size of the confidence region is very nearly a single point, or the entire population has been sampled; in both cases, the estimated parameter set is essentially the same as the population parameter set.
Under the AIC paradigm, likelihood is interpreted within the context of information theory.