# Likelihood Ratio Test

A likelihood ratio test is a statistical test used to compare the goodness of fit of two models, one of which (the null model) is a special case of the other (the alternative model). The test is based on the likelihood, which expresses how many times more likely the data are under one model than the other. This likelihood ratio, or equivalently its logarithm, can then be used to compute a p-value, or compared to a critical value to decide whether to reject the null model in favor of the alternative model. When the logarithm of the likelihood ratio is used, the statistic is known as a log-likelihood ratio statistic, and the probability distribution of this test statistic, assuming that the null model is true, can be approximated using Wilks’ theorem.

## Hypothesis Testing

We assume the usual setup: $X_1,\ldots,X_n$ denotes a random sample drawn from an unknown distribution with probability density belonging to a certain (parametrized) family $\{f(x \mid \theta) : \theta \in \Theta \}$ and define the likelihood function

[$] \mathcal{L}(\theta\,;X_1,\ldots,X_n) = f(X_1,\ldots,X_n\mid\theta) = \prod_{i=1}^n f(X_i\mid\theta). [$]

### Composite Hypothesis

A null hypothesis is often stated by saying the parameter $\theta$ is in a specified subset $\Theta_0$ of the parameter space $\Theta$.

[$] \begin{equation} H_0: \theta \in \Theta_0, \hspace{5 pt} H_1: \theta \in \Theta_0^c \end{equation} [$]

The likelihood function is $L(\theta|x) = f(x \mid \theta)$ with $f(x \mid \theta)$ being the probability density function or probability mass function, which is a function of the parameter $\theta$ with $x$ held fixed at the value that was actually observed, i.e., the data. The likelihood ratio test statistic is

[$]\Lambda = \frac{\sup\{\,\mathcal{L}(\theta\mid X_1,\ldots,X_n): \theta\in\Theta_0\,\}}{\sup\{\,\mathcal{L}(\theta\mid X_1,\ldots,X_n): \theta\in\Theta\,\}}.[$]

Here, the $\sup$ notation refers to the supremum function.

A likelihood ratio test is any test with critical region (or rejection region) of the form $\{x \mid \Lambda \le c\}$ where $c$ is any number satisfying $0\le c\le 1$.

#### Interpretation

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 of Type I error is considered tolerable ("Type I" errors consist of the rejection of a null hypothesis that is true).

The numerator corresponds to the maximum likelihood of an observed outcome under the null hypothesis. The denominator 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 — the likelihood ratio is between 0 and 1. Low values of the likelihood ratio mean that the observed result was 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 the null hypothesis cannot be rejected.

#### Distribution: Wilks’ theorem

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 accept/reject the null hypothesis). In most cases, however, the exact distribution of the likelihood ratio corresponding to specific hypotheses is very difficult to determine. A convenient result by Samuel S. Wilks, says that as the sample size $n$ approaches infinity, the test statistic $-2 \log(\Lambda)$ for a nested model will be asymptotically $\chi^2$-distributed with degrees of freedom equal to the difference in dimensionality of $\Theta$ and $\Theta_0$. This means that for a great variety of hypotheses, a practitioner can compute the likelihood ratio $\Lambda$ for the data and compare $-2\log(\Lambda)$ to the $\chi^2$ value corresponding to a desired statistical significance as an approximate statistical test.

Wilks’ theorem assumes that the true but unknown values of the estimated parameters are in the interior of the parameter space. This is commonly violated in, for example, random or mixed effects models when one of the variance components is negligible relative to the others. In some such cases with one variance component essentially zero relative to the others or the models are not properly nested, Pinheiro and Bates showed that the true distribution of this likelihood ratio chi-square statistic could be substantially different from the naive $\chi^2$, often dramatically so. The naive assumptions could give significance probabilities (p-values) that are far too large on average in some cases and far too small in other.

### Use

Each of the two competing models, the null model and the alternative model, is separately fitted to the data and the log-likelihood recorded. The test statistic (often denoted by $D$) is twice the log of the likelihoods ratio:

[] \begin{align} D & = -2\log \left( \Lambda \right ) \\ & = 2\sup_{\theta \in \Theta} \sum_{i=1}^{n} \log\left(\mathcal{L}(\theta\,;X_i)\right) - 2 \sup_{\theta \in \Theta_0} \sum_{i=1}^{n} \log \left(\mathcal{L}(\theta\,;X_i)\right) \end{align} []

The model with more parameters (here alternative) will always fit at least as well. Whether it fits significantly better and should thus be preferred is determined by deriving the probability or p-value of the difference $D$. Where the null hypothesis represents a special case of the alternative hypothesis, the probability distribution of the test statistic is approximately a chi-squared distribution with degrees of freedom equal to

[$] \mathrm{Dim}(\Theta) - \mathrm{Dim}(\Theta_0) [$]

where $\mathrm{Dim}(\cdot)$ denotes the number of dimensions .

The likelihood-ratio test requires nested models – models in which the more complex one can be transformed into the simpler model by imposing a set of constraints on the parameters.