Instatistics, thelikelihood-ratio test is ahypothesis test that involves comparing thegoodness of fit of two competingstatistical models, typically one found bymaximization over the entireparameter space and another found after imposing someconstraint, based on the ratio of theirlikelihoods. If the more constrained model (i.e., thenull hypothesis) is supported by theobserved data, the two likelihoods should not differ by more thansampling error.[1] Thus the likelihood-ratio test tests whether this ratio issignificantly different from one, or equivalently whether itsnatural logarithm is significantly different from zero.
The likelihood-ratio test, also known asWilks test,[2] is the oldest of the three classical approaches to hypothesis testing, together with theLagrange multiplier test and theWald test.[3] In fact, the latter two can be conceptualized as approximations to the likelihood-ratio test, and are asymptotically equivalent.[4][5][6] In the case of comparing two models each of which has no unknownparameters, use of the likelihood-ratio test can be justified by theNeyman–Pearson lemma. The lemma demonstrates that the test has the highestpower among all competitors.[7]
Suppose that we have astatistical model withparameter space. Anull hypothesis is often stated by saying that the parameter lies in a specified subset of. Thealternative hypothesis is thus that lies in thecomplement of, i.e. in, which is denoted by. The likelihood ratiotest statistic for the null hypothesis is given by:[8]
where the quantity inside the brackets is called the likelihood ratio. Here, the notation refers to thesupremum. As all likelihoods are positive, and as the constrained maximum cannot exceed the unconstrained maximum, the likelihood ratio isbounded between zero and one.
Often the likelihood-ratio test statistic is expressed as a difference between thelog-likelihoodswhereis the logarithm of the maximized likelihood function, and is the maximal value in the special case that the null hypothesis is true (but not necessarily a value that maximizes for the sampled data) anddenote the respectivearguments of the maxima and the allowed ranges they're embedded in. Multiplying by −2 ensures mathematically that (byWilks' theorem) converges asymptotically to beingχ²-distributed if the null hypothesis happens to be true.[9] Thefinite-sample distributions of likelihood-ratio statistics are generally unknown.[10]
The likelihood-ratio test requires that the models benested – i.e. the more complex model can be transformed into the simpler model by imposing constraints on the former's parameters. Many common test statistics are tests for nested models and can be phrased as log-likelihood ratios or approximations thereof: e.g. theZ-test, theF-test, theG-test, andPearson's chi-squared test; for an illustration with theone-samplet-test, see below.
If the models are not nested, then instead of the likelihood-ratio test, there is a generalization of the test that can usually be used: for details, seerelative likelihood.
A simple-vs.-simple hypothesis test has completely specified models under both the null hypothesis and the alternative hypothesis, which for convenience are written in terms of fixed values of a notional parameter:
In this case, under either hypothesis, the distribution of the data is fully specified: there are no unknown parameters to estimate. For this case, a variant of the likelihood-ratio test is available:[11][12]
Some older references may use the reciprocal of the function above as the definition.[13] Thus, the likelihood ratio is small if the alternative model is better than the null model.
The likelihood-ratio test provides the decision rule as follows:
The values and are usually chosen to obtain a specifiedsignificance level, via the relationTheNeyman–Pearson lemma states that this likelihood-ratio test is themost powerful among all level tests for this case.[7][12]
The likelihood ratio is a function of the data; therefore, it is astatistic, although unusual in that the statistic's value depends on a parameter,. The likelihood-ratio test rejects the null hypothesis if the value of this statistic is too small. How small is too small depends on the significance level of the test, i.e. on what probability ofType I error is considered tolerable (Type I errors consist of the rejection of a null hypothesis that is true).
Thenumerator corresponds to the likelihood of an observed outcome under thenull hypothesis. Thedenominator corresponds to the maximum likelihood of an observed outcome, varying parameters over the whole parameter space. The numerator of this ratio is less than the denominator; so, the likelihood ratio is between 0 and 1. Low values of the likelihood ratio mean that the observed result was much less likely to occur under the null hypothesis as compared to the alternative. High values of the statistic mean that the observed outcome was nearly as likely to occur under the null hypothesis as the alternative, and so the null hypothesis cannot be rejected.
The following example is adapted and abridged fromStuart, Ord & Arnold (1999, §22.2).
Suppose that we have a random sample, of sizen, from a population that is normally-distributed. Both the mean,μ, and the standard deviation,σ, of the population are unknown. We want to test whether the mean is equal to a given value,μ0.
Thus, our null hypothesis isH0: μ =μ0 and our alternative hypothesis isH1: μ ≠μ0 . The likelihood function is
With some calculation (omitted here), it can then be shown that wheret is thet-statistic withn − 1 degrees of freedom. Hence we may use the known exact distribution oftn−1 to draw inferences.
If the distribution of the likelihood ratio corresponding to a particular null and alternative hypothesis can be explicitly determined then it can directly be used to form decision regions (to sustain or reject the null hypothesis). In most cases, however, the exact distribution of the likelihood ratio corresponding to specific hypotheses is very difficult to determine.[citation needed]
AssumingH0 is true, there is a fundamental result bySamuel S. Wilks: As the sample size approaches, and if the null hypothesis lies strictly within the interior of the parameter space, the test statistic defined above will beasymptoticallychi-squared distributed () withdegrees of freedom equal to the difference in dimensionality of and.[14] This implies that for a great variety of hypotheses, we can calculate the likelihood ratio for the data and then compare the observed to the value corresponding to a desiredstatistical significance as anapproximate statistical test. Other extensions exist.[which?]