3.4 Generalised Likelihood Ratio Tests

When \(H_0\) is composite, or the alternative is two-sided, or there are nuisance parameters, a UMP test usually does not exist. A general method that always gives a sensible test replaces each likelihood in the Neyman–Pearson ratio by its largest value under the hypothesis concerned.

Definition 3.4.1. The generalised likelihood ratio for testing \(H_0\colon \theta \in \Omega _0\) against \(H_1\colon \theta \in \Omega - \Omega _0\) is \[\Lambda (x) = \frac {\sup _{\theta \in \Omega } L(\theta ;x)}{\sup _{\theta \in \Omega _0} L(\theta ;x)} = \frac {L(\hat \theta ;x)}{L(\hat \theta _0;x)} ,\] where \(\hat \theta \) is the maximum likelihood estimate over the whole parameter space and \(\hat \theta _0\) is the maximum likelihood estimate under the restriction \(\theta \in \Omega _0\). The generalised likelihood ratio test (GLRT) rejects \(H_0\) when \(\Lambda (x)>k\), with \(k\) chosen so that \(\sup _{\theta \in \Omega _0} P_\theta (\Lambda (X)>k) = \alpha \).

Remark 3.4.2.

1.
Since \(\Omega _0\subset \Omega \), the numerator is at least the denominator, so \(\Lambda (x)\ge 1\), and large values are evidence against \(H_0\).
2.
As with the Neyman–Pearson ratio, the inequality \(\Lambda (x)>k\) is simplified to a statement about a familiar statistic. When the exact distribution of \(\Lambda (X)\) is out of reach, theorem 3.4.7 gives an approximation.

Example 3.4.3. Let \(X_1,\dots ,X_n\) be a random sample from \(N(\mu ,\sigma ^2)\) with \(\sigma ^2\) known. Find the GLRT of size \(\alpha \) of \(H_0\colon \mu = \mu _0\) against \(H_1\colon \mu \ne \mu _0\).

Solution. Here \(\Omega = \mathbb {R}\) and \(\Omega _0 = \{\mu _0\}\). The unrestricted MLE is \(\hat \mu = \bar x\) and the restricted one is \(\mu _0\), so \[\Lambda (x) = \frac {(2\pi \sigma ^2)^{-n/2}\exp \left (-\frac {1}{2\sigma ^2}\sum (x_i - \bar x)^2\right )} {(2\pi \sigma ^2)^{-n/2}\exp \left (-\frac {1}{2\sigma ^2}\sum (x_i - \mu _0)^2\right )} = \exp \left (\frac {1}{2\sigma ^2}\left [\sum (x_i - \mu _0)^2 - \sum (x_i - \bar x)^2\right ]\right ).\] Writing \(x_i - \mu _0 = (x_i - \bar x) + (\bar x - \mu _0)\) and using \(\sum (x_i - \bar x) = 0\), \begin {equation} \label {eq:sumsquaressplit} \sum (x_i - \mu _0)^2 = \sum (x_i - \bar x)^2 + n(\bar x - \mu _0)^2 . \end {equation} So \[\Lambda (x) = \exp \left (\frac {n(\bar x - \mu _0)^2}{2\sigma ^2}\right ) = \exp \left (\frac {z^2}{2}\right ),\qquad z = \frac {\bar x - \mu _0}{\sigma /\sqrt n} .\] \(\Lambda >k\) is equivalent to \(|z|>c\). Under \(H_0\), \(Z\sim N(0,1)\), so \(c = z_{\alpha /2}\) and the GLRT is the familiar two-sided \(z\) test: reject \(H_0\) if \[\left |\frac {\bar x - \mu _0}{\sigma /\sqrt n}\right |>z_{\alpha /2} .\] Note that \(2\ln \Lambda = z^2\sim \chi ^2(1)\) exactly under \(H_0\).

Example 3.4.4. Let \(X_1,\dots ,X_n\) be a random sample from \(N(\mu ,\sigma ^2)\) with both parameters unknown, and consider \(H_0\colon \mu = 0\) against \(H_1\colon \mu \ne 0\).

(a)
Show that the GLRT rejects \(H_0\) when \(\frac {n\bar x^2}{s^2}>c\), where \(s^2 = \frac {1}{n-1}\sum (x_i - \bar x)^2\).
(b)
Show that \(T = \frac {n\bar X^2}{S^2}\sim F(1,n-1)\) under \(H_0\), and find the test of size \(0.05\) for \(n = 20\).

Solution.

(a)
Here \(\theta = (\mu ,\sigma ^2)\), \(\Omega = \{(\mu ,\sigma ^2) : \mu \in \mathbb {R}, \sigma ^2>0\}\) and \(\Omega _0 = \{(0,\sigma ^2) : \sigma ^2>0\}\). The log likelihood is \[l(\mu ,\sigma ^2) = -\frac n2\ln (2\pi \sigma ^2) - \frac {1}{2\sigma ^2}\sum (x_i - \mu )^2 .\] Over \(\Omega \) the MLEs are \(\hat \mu = \bar x\) and \(\hat \sigma ^2 = \frac 1n\sum (x_i - \bar x)^2\) (example 2.5.7). Substituting, the exponent becomes \(-\frac {n\hat \sigma ^2}{2\hat \sigma ^2} = -\frac n2\), so \[L(\hat \theta ;x) = (2\pi \hat \sigma ^2)^{-n/2}e^{-n/2} .\] Under \(H_0\), \(\mu = 0\) and the score equation \(\frac {\partial l}{\partial \sigma ^2} = -\frac {n}{2\sigma ^2} + \frac {1}{2\sigma ^4}\sum x_i^2 = 0\) gives \(\hat \sigma _0^2 = \frac 1n\sum x_i^2\), and in the same way \[L(\hat \theta _0;x) = (2\pi \hat \sigma _0^2)^{-n/2}e^{-n/2} .\] Hence, using (3.4) with \(\mu _0 = 0\), \begin {align*} \Lambda (x) &= \left (\frac {\hat \sigma _0^2}{\hat \sigma ^2}\right )^{n/2} = \left (\frac {\sum x_i^2}{\sum (x_i - \bar x)^2}\right )^{n/2}\\ &= \left (1 + \frac {n\bar x^2}{\sum (x_i - \bar x)^2}\right )^{n/2} = \left (1 + \frac {1}{n-1}\cdot \frac {n\bar x^2}{s^2}\right )^{n/2} . \end {align*}

This is an increasing function of \(\frac {n\bar x^2}{s^2}\), so \(\Lambda >k\) is equivalent to \(\frac {n\bar x^2}{s^2}>c\).

(b)
Write \[T = \frac {n\bar X^2}{S^2} = \frac {\left (\frac {\bar X}{\sigma /\sqrt n}\right )^2/1} {\frac {(n-1)S^2}{\sigma ^2}\Big /(n-1)} .\] Under \(H_0\), \(\frac {\bar X}{\sigma /\sqrt n}\sim N(0,1)\), so its square is \(\chi ^2(1)\); \(\frac {(n-1)S^2}{\sigma ^2}\sim \chi ^2(n-1)\); and \(\bar X\) and \(S^2\) are independent. By definition 1.3.41, \(T\sim F(1,n-1)\). For \(n = 20\) and size \(0.05\), \[P(F(1,19)>c) = 0.05\quad \Longrightarrow \quad c = 4.38 ,\] so the test rejects \(H_0\) if \(\frac {20\bar x^2}{s^2}>4.38\). Since \(T = \left (\frac {\bar X}{S/\sqrt n}\right )^2\) is the square of the one-sample \(t\) statistic and \(t_{19,0.025}^2 = 2.093^2 = 4.38\), this is the two-sided \(t\) test.

The same distributional facts give the variance of \(S^2\), which is needed when comparing estimators of \(\sigma ^2\).

Example 3.4.5. For a random sample from \(N(\mu ,\sigma ^2)\), find \(\operatorname {Var}(S^2)\).

Solution. Since \(W = \frac {(n-1)S^2}{\sigma ^2}\sim \chi ^2(n-1)\) has variance \(2(n-1)\), \[\operatorname {Var}(S^2) = \operatorname {Var}\left (\frac {\sigma ^2}{n-1}W\right ) = \frac {\sigma ^4}{(n-1)^2}\cdot 2(n-1) = \frac {2\sigma ^4}{n-1} .\]

Example 3.4.6. Let \(X_1,\dots ,X_n\) and \(Y_1,\dots ,Y_m\) be independent random samples from the exponential distributions with means \(\theta \) and \(\mu \): \[f(x;\theta ) = \frac 1\theta e^{-x/\theta },\ x>0,\qquad f(y;\mu ) = \frac 1\mu e^{-y/\mu },\ y>0 .\]

(a)
Show that the generalised likelihood ratio for testing \(H_0\colon \theta = \mu \) against \(H_1\colon \theta \ne \mu \) is a function of \[T = \frac {\sum _{i=1}^n X_i}{\sum _{i=1}^n X_i + \sum _{j=1}^m Y_j} .\]
(b)
Find the distribution of \(T\) under \(H_0\).

Solution.

(a)
Write \(s_x = \sum x_i = n\bar x\), \(s_y = \sum y_j = m\bar y\) and \(s = s_x + s_y\). The log likelihood is \[l(\theta ,\mu ) = -n\ln \theta - \frac {s_x}{\theta } - m\ln \mu - \frac {s_y}{\mu } .\] Setting \(\frac {\partial l}{\partial \theta } = -\frac n\theta + \frac {s_x}{\theta ^2}\) and \(\frac {\partial l}{\partial \mu }\) to zero gives \(\hat \theta = \bar x\) and \(\hat \mu = \bar y\), and then \[L(\hat \theta ,\hat \mu ) = \bar x^{-n}\bar y^{-m}e^{-(n+m)} .\] Under \(H_0\) the two samples share the mean \(\theta \), \(l(\theta ) = -(n+m)\ln \theta - \frac {s}{\theta }\), the restricted MLE is \(\hat \theta _0 = \frac {s}{n+m}\), and \[L(\hat \theta _0,\hat \theta _0) = \left (\frac {s}{n+m}\right )^{-(n+m)}e^{-(n+m)} .\] Hence \[\Lambda = \frac {\left (\frac {s}{n+m}\right )^{n+m}}{\bar x^n\bar y^m} .\] With \(t = \frac {s_x}{s}\) we have \(\bar x = \frac {ts}{n}\) and \(\bar y = \frac {(1-t)s}{m}\), so the powers of \(s\) cancel and \[\Lambda = \frac {n^n m^m}{(n+m)^{n+m}}\cdot \frac {1}{t^n(1-t)^m} .\] This depends on the data only through \(t\). The GLRT rejects \(H_0\) when \(t^n(1-t)^m<c\), that is, when \(t\) is too close to \(0\) or too close to \(1\): one sample has a much larger total than the other would suggest.
(b)
Under \(H_0\), divide numerator and denominator by \(\theta \): \(T = \frac {U}{U+V}\) with \(U = \frac {\sum X_i}{\theta }\) and \(V = \frac {\sum Y_j}{\theta }\). Each \(\frac {X_i}{\theta }\sim \text {EXP}(1)\) with m.g.f. \((1-u)^{-1}\), so \(U\) has m.g.f. \((1-u)^{-n}\) and \(U\sim \text {GAM}(n,1)\); likewise \(V\sim \text {GAM}(m,1)\), independent of \(U\). By example 1.3.12, \(T = \frac {U}{U+V}\sim \text {BETA}(n,m)\). The critical values are therefore beta quantiles, chosen so that the two tails of \(t^n(1-t)^m<c\) have total probability \(\alpha \).

The large-sample distribution of the likelihood ratio

In the examples above the GLRT reduced to a statistic with a known distribution. When it does not, the following result of Wilks gives an approximation.

Theorem 3.4.7 (Wilks). Suppose the regularity conditions for the asymptotic normality of maximum likelihood estimators hold, \(\Omega \) is an open subset of \(\mathbb {R}^p\), and \(\Omega _0\) is defined by fixing \(r\) of the parameters (or, more generally, by \(r\) independent smooth restrictions). Then under \(H_0\), \[2\ln \Lambda (X)\ \xrightarrow {d}\ \chi ^2(r)\qquad \text {as } n\to \infty .\] The approximate GLRT of size \(\alpha \) rejects \(H_0\) when \(2\ln \Lambda (x)>\chi ^2_{r,\alpha }\).

Sketch for one parameter. Take \(p = r = 1\) and \(\Omega _0 = \{\theta _0\}\), so \(2\ln \Lambda = 2\left [l(\hat \theta ) - l(\theta _0)\right ]\). Expand \(l(\theta _0)\) about \(\hat \theta \), where \(l'(\hat \theta ) = 0\): \[l(\theta _0) = l(\hat \theta ) + \frac 12 l''(\theta ^*)(\theta _0 - \hat \theta )^2\] for some \(\theta ^*\) between \(\theta _0\) and \(\hat \theta \). So \[2\ln \Lambda = -l''(\theta ^*)(\hat \theta - \theta _0)^2 = \frac {-l''(\theta ^*)}{nI(\theta _0)}\left [\sqrt {nI(\theta _0)}\,(\hat \theta - \theta _0)\right ]^2 ,\] where \(I(\theta )\) is the Fisher information in one observation. Under \(H_0\), \(\hat \theta \to \theta _0\), the law of large numbers gives \(-\frac 1n l''(\theta ^*)\to I(\theta _0)\), and \(\sqrt {nI(\theta _0)}(\hat \theta - \theta _0)\xrightarrow {d}N(0,1)\). So the first factor tends to \(1\) and the second to the square of a standard normal, which is \(\chi ^2(1)\). □

The degrees of freedom \(r\) are the number of free parameters under \(H_1\) minus the number under \(H_0\). In example 3.4.3, \(r = 1 - 0 = 1\) and \(2\ln \Lambda = z^2\) is exactly \(\chi ^2(1)\); in example 3.4.4, \(r = 2 - 1 = 1\) and \(2\ln \Lambda = n\ln \left (1 + \frac {t^2}{n-1}\right )\approx t^2\), again \(\chi ^2(1)\) for large \(n\).

Example 3.4.8. The numbers of calls arriving at a switchboard in \(50\) one-minute intervals have mean \(\bar x = 2.4\). Assuming a Poisson\((\lambda )\) model, test \(H_0\colon \lambda = 2\) against \(H_1\colon \lambda \ne 2\) at the \(5\%\) level with the GLRT and its \(\chi ^2\) approximation.

Solution. The log likelihood is \(l(\lambda ) = n\bar x\ln \lambda - n\lambda - \sum \ln x_i!\), with unrestricted MLE \(\hat \lambda = \bar x\). So \[2\ln \Lambda = 2\left [l(\bar x) - l(\lambda _0)\right ] = 2n\left [\bar x\ln \frac {\bar x}{\lambda _0} - (\bar x - \lambda _0)\right ].\] With \(n = 50\), \(\bar x = 2.4\) and \(\lambda _0 = 2\), \[2\ln \Lambda = 100\left [2.4\ln 1.2 - 0.4\right ] = 100\left [0.43757 - 0.4\right ] = 3.757 .\] Here \(r = 1\) and \(\chi ^2_{1,0.05} = 3.841\). Since \(3.757<3.841\) we do not reject \(H_0\); the approximate \(p\)-value is \(P(\chi ^2(1)>3.757) = 0.053\).

For comparison, the Wald statistic \(\frac {\bar x - \lambda _0}{\sqrt {\lambda _0/n}} = \frac {0.4}{0.2} = 2.0\) has square \(4.0>3.841\) and would just reject. The two statistics agree to first order in large samples, but at the edge of the critical region they can lead to different decisions; the likelihood ratio uses the shape of the whole log likelihood and is usually preferred.

Further reading

1.
Neyman, J., and Pearson, E. S. (1928), On the use and interpretation of certain test criteria for purposes of statistical inference, Biometrika, 20A, 175–240 and 263–294.
2.
Neyman, J., and Pearson, E. S. (1933), On the problem of the most efficient tests of statistical hypotheses, Philosophical Transactions of the Royal Society A, 231, 289–337.
3.
Wilks, S. S. (1938), The large-sample distribution of the likelihood ratio for testing composite hypotheses, Annals of Mathematical Statistics, 9, 60–62.
4.
Karlin, S., and Rubin, H. (1956), The theory of decision procedures for distributions with monotone likelihood ratio, Annals of Mathematical Statistics, 27, 272–299.
5.
Lehmann, E. L., and Romano, J. P. (2005), Testing Statistical Hypotheses, 3rd edition, Springer, chapters 3 and 12.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.