General Suppose that we have a
statistical model with
parameter space \Theta. A
null hypothesis is often stated by saying that the parameter \theta lies in a specified subset \Theta_0 of \Theta. The
alternative hypothesis is thus that \theta lies in the
complement of \Theta_0, i.e. in \Theta ~ \backslash ~ \Theta_0, which is denoted by \Theta_0^\text{c}. The likelihood ratio
test statistic for the null hypothesis H_0 \, : \, \theta \in \Theta_0 is given by: \lambda_\text{LR} = -2 \ln \left[ \frac{~ \sup_{\theta \in \Theta_0} \mathcal{L}(\theta) ~}{~ \sup_{\theta \in \Theta} \mathcal{L}(\theta) ~} \right] where the quantity inside the brackets is called the likelihood ratio. Here, the \sup notation refers to the
supremum. As all likelihoods are positive, and as the constrained maximum cannot exceed the unconstrained maximum, the likelihood ratio is
bounded between zero and one and the likelihood ratio test statistic between 0 and infinity. Often the likelihood-ratio test statistic is expressed as a difference between the
log-likelihoods \lambda_\text{LR} = -2 \left[ \ell( \theta_0 ) - \ell( \hat{\theta} ) \right] where \ell( \hat{\theta} ) \equiv \ln \left[\,\sup_{\theta \in \Theta} \mathcal{L}(\theta) \,\right] is the logarithm of the maximized likelihood function \mathcal{L}, and \ell(\theta_0) is the maximal value in the special case that the null hypothesis is true (but not necessarily a value that maximizes \mathcal{L} for the sampled data) and \theta_0 \in \Theta_0 \qquad \text{ and } \qquad \hat{\theta} \in \Theta~ denote the respective
arguments of the maxima and the allowed ranges they're embedded in. Multiplying by −2 ensures mathematically that (by
Wilks' theorem) \lambda_\text{LR} converges asymptotically to being
²-distributed if the null hypothesis happens to be true. The
finite-sample distributions of likelihood-ratio statistics are generally unknown. The likelihood-ratio test requires that the models be
nested – 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. the
Z-test, the
F-test, the
G-test, and
Pearson's chi-squared test; for an illustration with the
one-sample t-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, see
relative likelihood.
Case of simple hypotheses 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 \theta: \begin{align} H_0 &:& \theta=\theta_0 ,\\ H_1 &:& \theta=\theta_1 . \end{align} 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: \Lambda(x) = \frac{~\mathcal{L}(\theta_0\mid x) ~}{~\mathcal{L}(\theta_1\mid x) ~}. Some older references may use the reciprocal of the function above as the definition. 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 c and q are usually chosen to obtain a specified
significance level \alpha, via the relation q \Pr(\Lambda=c \mid H_0) ~ + ~ \Pr(\Lambda The
Neyman–Pearson lemma states that this likelihood-ratio test is the
most powerful among all level \alpha tests for this case. ==Interpretation==