Lecture 22 The Neyman–Pearson Lemma

In lecture 20 it was clear that for the mean of a normal sample we could not do better than to reject for large values of X¯\bar{X}. This lecture proves that this is indeed correct: for the most basic testing problem, where one distribution is being tested against a different distribution, the Neyman–Pearson lemma allows us to identify the most powerful test. This is in analogy to the role of the Cramer–Rao bound from lecture 13 for estimators. The same test is optimal for all one-sided alternatives, but there is no single test which is optimal for a two-sided alternative. In fact, in lecture 23 we will see the required tool for this case.

22.1 Simple Hypotheses and Most Powerful Tests

We consider the problem of testing a simple null hypothesis H0:θ=θ0H_{0}\colon\theta=\theta_{0} against a simple alternative H1:θ=θ1H_{1}\colon\theta=\theta_{1}, where θ0≠θ1\theta_{0}\neq\theta_{1} are two fixed points of the parameter space, for data X=(X1,…,Xn)X=(X_{1},\dots,X_{n}) with joint density or probability weights f⁢(x;θ)f(x;\theta) as in lecture 8. Under either hypothesis the distribution of the data is completely specified; section 22.4 shows that the solution of this problem also settles more realistic ones.

We will compare different tests, so we write βC⁢(θ)=ℙθ⁢(X∈C)\beta_{C}(\theta)=\mathbb{P}_{\theta}(X\in C) for the power function of definition 20.4 of the test with critical region CC. For simple hypotheses, the size from definition 20.5 and the power are the single numbers βC⁢(θ0)\beta_{C}(\theta_{0}) and βC⁢(θ1)\beta_{C}(\theta_{1}). Among all tests with level α\alpha, i.e. with βC⁢(θ0)≤α\beta_{C}(\theta_{0})\leq\alpha, we want to find the test which makes type II errors least often.

Definition 22.1.

Let 0<α<10<\alpha<1. A test with critical region CC is said to be most powerful at level α\alpha for testing H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ=θ1H_{1}\colon\theta=\theta_{1}, if βC⁢(θ0)≤α\beta_{C}(\theta_{0})\leq\alpha and

βC⁢(θ1)≥βC′⁢(θ1)\beta_{C}(\theta_{1})\geq\beta_{C^{\prime}}(\theta_{1})

for all critical regions C′C^{\prime} with βC′⁢(θ0)≤α\beta_{C^{\prime}}(\theta_{0})\leq\alpha.

As with the uniformly minimum variance unbiased estimator from definition 10.3, the definition does not give a method to find such a test or even whether such a test exists; we will answer both of these questions in the next section.

22.2 The Lemma

If f⁢(x;θ1)f(x;\theta_{1}) is much larger than f⁢(x;θ0)f(x;\theta_{0}), the data favour the alternative, and we should reject. The natural test statistic is the likelihood ratio

R⁢(x)=f⁢(x;θ1)f⁢(x;θ0)=L⁢(θ1)L⁢(θ0),R(x)=\frac{f(x;\theta_{1})}{f(x;\theta_{0})}=\frac{L(\theta_{1})}{L(\theta_{0}% )},

and the natural test rejects if R⁢(X)R(X) exceeds some threshold kk. The lemma states that no test with the same level can have more power. We write the inequality f⁢(x;θ1)>k⁢f⁢(x;θ0)f(x;\theta_{1})>k\,f(x;\theta_{0}) instead of R⁢(x)>kR(x)>k so that points with f⁢(x;θ0)=0f(x;\theta_{0})=0 do not require separate treatment and so that the boundary of the critical region can include any points where equality holds, as required for discrete models and in exercise 22.3.

Theorem 22.2 (Neyman–Pearson lemma).

Let k≥0k\geq 0 and let CC be a critical region with

{x|f⁢(x;θ1)>k⁢f⁢(x;θ0)}⊆C⊆{x|f⁢(x;θ1)≥k⁢f⁢(x;θ0)},\bigl{\{}x\mathrel{\big{|}}f(x;\theta_{1})>k\,f(x;\theta_{0})\bigr{\}}% \subseteq C\subseteq\bigl{\{}x\mathrel{\big{|}}f(x;\theta_{1})\geq k\,f(x;% \theta_{0})\bigr{\}},

where α=βC⁢(θ0)\alpha=\beta_{C}(\theta_{0}) is the size of the critical region. Then the following statements hold.

  1. 1.
    ​

    The test with critical region CC is the most powerful test at level α\alpha for the hypothesis H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ=θ1H_{1}\colon\theta=\theta_{1}.

  2. 2.
    ​

    If C′C^{\prime} is another critical region, which is most powerful at level α\alpha for the same problem, then CC and C′C^{\prime} differ at most on the boundary set {x∣f⁢(x;θ1)=k⁢f⁢(x;θ0)}\{x\mid f(x;\theta_{1})=k\,f(x;\theta_{0})\}, except for a set of observations with probability zero for every θ∈Θ\theta\in\Theta.

Proof.

Let C′C^{\prime} be a critical region with βC′⁢(θ0)≤α\beta_{C^{\prime}}(\theta_{0})\leq\alpha and let 𝟏C\mathbf{1}_{C} and 𝟏C′\mathbf{1}_{C^{\prime}} be the indicator functions for the two regions. Then the proof is based on the observation that

equation (22.1) (22.1)
h⁢(x)=(𝟏C⁢(x)−𝟏C′⁢(x))⁢(f⁢(x;θ1)−k⁢f⁢(x;θ0))≥0for all ⁢x.h(x)=\bigl{(}\mathbf{1}_{C}(x)-\mathbf{1}_{C^{\prime}}(x)\bigr{)}\bigl{(}f(x;% \theta_{1})-k\,f(x;\theta_{0})\bigr{)}\geq 0\qquad\text{for all }x.

If x∈Cx\in C, the first factor is either 0 or 11 and the second factor is non-negative by the choice of CC. If x∉Cx\notin C, the first factor is either 0 or −1-1 and the second factor is zero or negative by the choice of CC.

Integrating (22.1) over all xx, with a sum in place of the integral for a discrete model, and using ∫𝟏A⁢(x)⁢f⁢(x;θ)⁢dx=ℙθ⁢(X∈A)=βA⁢(θ)\int\mathbf{1}_{A}(x)\,f(x;\theta)\,\mathrm{d}x=\mathbb{P}_{\theta}(X\in A)=% \beta_{A}(\theta) for each of the four terms, we find

equation (22.2) (22.2)
0≤∫h⁢(x)⁢dx=(βC⁢(θ1)−βC′⁢(θ1))−k⁢(βC⁢(θ0)−βC′⁢(θ0)).0\leq\int h(x)\,\mathrm{d}x=\bigl{(}\beta_{C}(\theta_{1})-\beta_{C^{\prime}}(% \theta_{1})\bigr{)}-k\bigl{(}\beta_{C}(\theta_{0})-\beta_{C^{\prime}}(\theta_{% 0})\bigr{)}.

Since βC⁢(θ0)=α≥βC′⁢(θ0)\beta_{C}(\theta_{0})=\alpha\geq\beta_{C^{\prime}}(\theta_{0}) and k≥0k\geq 0, the subtracted term is non-negative and thus we have

βC⁢(θ1)−βC′⁢(θ1)≥k⁢(α−βC′⁢(θ0))≥0,\beta_{C}(\theta_{1})-\beta_{C^{\prime}}(\theta_{1})\geq k\bigl{(}\alpha-\beta% _{C^{\prime}}(\theta_{0})\bigr{)}\geq 0,

and this is the first statement.

For the second statement assume that C′C^{\prime} is also most powerful at level α\alpha. Then βC′⁢(θ1)≥βC⁢(θ1)\beta_{C^{\prime}}(\theta_{1})\geq\beta_{C}(\theta_{1}) by definition 22.1, and βC⁢(θ1)≥βC′⁢(θ1)\beta_{C}(\theta_{1})\geq\beta_{C^{\prime}}(\theta_{1}) by the first statement, so that the two powers are equal and the first bracket in (22.2) vanishes. The right-hand side of (22.2) is then −k⁢(α−βC′⁢(θ0))≤0-k\bigl{(}\alpha-\beta_{C^{\prime}}(\theta_{0})\bigr{)}\leq 0, and together with the inequality on the left this gives ∫h⁢(x)⁢dx=0\int h(x)\,\mathrm{d}x=0. Now h⁢(x)>0h(x)>0 holds exactly for those xx which lie in one of the regions CC and C′C^{\prime} but not in the other and at which f⁢(x;θ1)≠k⁢f⁢(x;θ0)f(x;\theta_{1})\neq k\,f(x;\theta_{0}), since at such points both factors of hh are non-zero and, by the first paragraph, of the same sign. For a discrete model a sum of non-negative terms is zero only if every term is zero, and thus this set is empty. For a model with densities, a non-negative function with integral zero vanishes outside a set of measure zero, and a set of measure zero has probability zero under every density f⁢(x;θ)f(x;\theta). This completes the proof. ∎

Two comments help in using the lemma. First, the constant kk is rarely computed: whenever RR is a strictly monotone function of a simpler statistic TT, we rewrite R⁢(x)>kR(x)>k as T⁢(x)>cT(x)>c or T⁢(x)<cT(x)<c and choose cc from the distribution of T⁢(X)T(X) under θ0\theta_{0} to give size α\alpha. Second, the lemma shows that the test is most powerful at the level equal to its own size, whatever value that size takes. For models with densities, R⁢(X)R(X) usually has a continuous distribution, and thus in theory any size can be achieved and the boundary set in the second statement has probability zero. Together these results show that the second statement implies that the most powerful test is essentially unique. In addition, it can be shown (for example in exercise 22.4) that the most powerful test can be chosen to depend on the data only via a sufficient statistic.

Remark.

For discrete models the size ℙθ0⁢(R⁢(X)>k)\mathbb{P}_{\theta_{0}}\bigl{(}R(X)>k\bigr{)} of tests can only take certain values as kk changes and it is in general not possible to obtain a test with a given size α\alpha. The usual solution in textbooks, to randomise the test on the boundary set to achieve the required size, is not taken here. Instead, we consider the test with the largest possible size which is less than or equal to α\alpha. This test, by the result of exercise 22.1, will be the most powerful test for the smaller level.

22.3 The Normal Mean

We now apply the lemma to the normal-mean example from lecture 20: the test constructed there using common sense is the most powerful one.

Example 22.3.

Let X1,…,XnX_{1},\dots,X_{n} be i.i.d. N⁢(θ,σ2)N(\theta,\sigma^{2}) where σ2\sigma^{2} is known, and consider the hypothesis H0:θ=θ0H_{0}\colon\theta=\theta_{0} against the alternative H1:θ=θ1H_{1}\colon\theta=\theta_{1}, where θ1>θ0\theta_{1}>\theta_{0}. The joint density of the observations is f⁢(x;θ)=(2⁢π⁢σ2)−n/2⁢exp⁡(−∑i(xi−θ)2/(2⁢σ2))f(x;\theta)=(2\pi\sigma^{2})^{-n/2}\exp\bigl{(}-\sum_{i}(x_{i}-\theta)^{2}/(2% \sigma^{2})\bigr{)}. In the ratio of two densities, the constant factors cancel. After expanding the squares in the definition of the test statistic, we find

∑i=1n(xi−θ1)2−∑i=1n(xi−θ0)2=−2⁢(θ1−θ0)⁢∑i=1nxi+n⁢(θ12−θ02),\sum_{i=1}^{n}(x_{i}-\theta_{1})^{2}-\sum_{i=1}^{n}(x_{i}-\theta_{0})^{2}=-2(% \theta_{1}-\theta_{0})\sum_{i=1}^{n}x_{i}+n(\theta_{1}^{2}-\theta_{0}^{2}),

and thus

log⁡R⁢(x)=n⁢(θ1−θ0)σ2⁢x¯−n⁢(θ12−θ02)2⁢σ2.\log R(x)=\frac{n(\theta_{1}-\theta_{0})}{\sigma^{2}}\,\bar{x}-\frac{n(\theta_% {1}^{2}-\theta_{0}^{2})}{2\sigma^{2}}.

Since θ1−θ0>0\theta_{1}-\theta_{0}>0, the right-hand side is a strictly increasing function of x¯\bar{x} and the inequality R⁢(x)>kR(x)>k is equivalent to x¯>c\bar{x}>c where c=σ2⁢log⁡k/(n⁢(θ1−θ0))+(θ1+θ0)/2c=\sigma^{2}\log k/\bigl{(}n(\theta_{1}-\theta_{0})\bigr{)}+(\theta_{1}+\theta% _{0})/2. Thus, the critical region is of the form {x¯>c}\{\bar{x}>c\} and we can choose the value of cc by considering the size of the test: under H0H_{0} we have X¯∼N⁢(θ0,σ2/n)\bar{X}\sim N(\theta_{0},\sigma^{2}/n) by proposition A.3 and thus

ℙθ0⁢(X¯>c)=1−Φ⁢(n⁢(c−θ0)σ)=α\mathbb{P}_{\theta_{0}}(\bar{X}>c)=1-\Phi\Bigl{(}\frac{\sqrt{n}\,(c-\theta_{0}% )}{\sigma}\Bigr{)}=\alpha

if and only if

c=cα=θ0+z1−α⁢σn,c=c_{\alpha}=\theta_{0}+z_{1-\alpha}\frac{\sigma}{\sqrt{n}},

where z1−αz_{1-\alpha} is the (1−α)(1-\alpha)-quantile of the standard normal distribution. By theorem 22.2 the test which rejects for X¯>cα\bar{X}>c_{\alpha} is most powerful at level α\alpha and, since the boundary set {x¯=cα}\{\bar{x}=c_{\alpha}\} has probability zero, this is the only test up to sets of probability zero. This is the test from example 20.6. The power of this test for the alternative is

β⁢(θ1)=ℙθ1⁢(X¯>cα)=1−Φ⁢(z1−α−n⁢(θ1−θ0)σ).\beta(\theta_{1})=\mathbb{P}_{\theta_{1}}(\bar{X}>c_{\alpha})=1-\Phi\Bigl{(}z_% {1-\alpha}-\frac{\sqrt{n}\,(\theta_{1}-\theta_{0})}{\sigma}\Bigr{)}.

For n=25n=25, σ=2\sigma=2, θ0=10\theta_{0}=10 and α=0.05\alpha=0.05 we have z0.95=1.645z_{0.95}=1.645 and thus cα=10+1.645⋅2/5=10.658c_{\alpha}=10+1.645\cdot 2/5=10.658, and the power against θ1=11\theta_{1}=11 is 1−Φ⁢(1.645−2.5)=Φ⁢(0.855)=0.8041-\Phi(1.645-2.5)=\Phi(0.855)=0.804, the value we found in lecture 20. The lemma allows us to turn this number into a statement about all possible procedures: no test of level 0.050.05, based on the given 2525 observations, can be better.

22.4 One-Sided Alternatives

The threshold cα=θ0+z1−α⁢σ/nc_{\alpha}=\theta_{0}+z_{1-\alpha}\sigma/\sqrt{n} in example 22.3 does not involve θ1\theta_{1}: the alternative entered the computation only through the sign of θ1−θ0\theta_{1}-\theta_{0}, and thus every θ1>θ0\theta_{1}>\theta_{0} leads to the same critical region. This has a consequence for the composite problem of testing H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ>θ0H_{1}\colon\theta>\theta_{0}, the problem of interest in lecture 20.

Proposition 22.4.

Consider testing H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ>θ0H_{1}\colon\theta>\theta_{0}. Assume that CC is a critical region with βC⁢(θ0)=α\beta_{C}(\theta_{0})=\alpha which, for every θ1>θ0\theta_{1}>\theta_{0}, satisfies the condition from theorem 22.2 for testing θ0\theta_{0} against θ1\theta_{1}, for some constant k=k⁢(θ1)k=k(\theta_{1}) which may depend on θ1\theta_{1}. Then, for every θ1>θ0\theta_{1}>\theta_{0} and every critical region C′C^{\prime} with βC′⁢(θ0)≤α\beta_{C^{\prime}}(\theta_{0})\leq\alpha, we have βC⁢(θ1)≥βC′⁢(θ1)\beta_{C}(\theta_{1})\geq\beta_{C^{\prime}}(\theta_{1}).

Proof.

Let θ1>θ0\theta_{1}>\theta_{0} and let C′C^{\prime} be a critical region with βC′⁢(θ0)≤α\beta_{C^{\prime}}(\theta_{0})\leq\alpha. Then, since the null hypothesis is simple, C′C^{\prime} is also a test of level α\alpha for the simple hypothesis θ0\theta_{0} against θ1\theta_{1} and by assumption CC satisfies the condition from theorem 22.2 for this problem. Thus, by the first statement of the theorem, we have βC⁢(θ1)≥βC′⁢(θ1)\beta_{C}(\theta_{1})\geq\beta_{C^{\prime}}(\theta_{1}) and since θ1\theta_{1} was arbitrary this completes the proof. ∎

A test which has this property is most powerful against every alternative in H1H_{1} simultaneously and is said to be uniformly most powerful at level α\alpha. We only use this name as a description and do not consider the general theory of such tests.

For the normal mean, example 22.3 shows that the critical region {x¯>θ0+z1−α⁢σ/n}\{\bar{x}>\theta_{0}+z_{1-\alpha}\sigma/\sqrt{n}\} is the Neyman–Pearson region for every θ1>θ0\theta_{1}>\theta_{0}, and thus the one-sided test of example 20.6 is uniformly most powerful against H1:θ>θ0H_{1}\colon\theta>\theta_{0}, with power function

β+⁢(θ)=1−Φ⁢(z1−α−n⁢(θ−θ0)σ).\beta_{+}(\theta)=1-\Phi\Bigl{(}z_{1-\alpha}-\frac{\sqrt{n}\,(\theta-\theta_{0% })}{\sigma}\Bigr{)}.

For alternatives θ1<θ0\theta_{1}<\theta_{0} the same computation with the inequality reversed gives the region {x¯<θ0−z1−α⁢σ/n}\{\bar{x}<\theta_{0}-z_{1-\alpha}\sigma/\sqrt{n}\}, uniformly most powerful against H1:θ<θ0H_{1}\colon\theta<\theta_{0}, with power function

β−⁢(θ)=1−Φ⁢(z1−α+n⁢(θ−θ0)σ).\beta_{-}(\theta)=1-\Phi\Bigl{(}z_{1-\alpha}+\frac{\sqrt{n}\,(\theta-\theta_{0% })}{\sigma}\Bigr{)}.

22.5 Two-Sided Alternatives

We now consider the alternative H1:θ≠θ0H_{1}\colon\theta\neq\theta_{0}. The two one-sided tests disagree: one rejects for large values of X¯\bar{X}, the other for small values, and each one is poor on the other side of θ0\theta_{0}, since for θ<θ0\theta<\theta_{0} we have β+⁢(θ)<α\beta_{+}(\theta)<\alpha. Thus, no single test can agree with both tests simultaneously, and the uniqueness statement in the lemma implies that this argument constitutes a proof.

Proposition 22.5.

Let X1,…,XnX_{1},\dots,X_{n} be i.i.d. N⁢(θ,σ2)N(\theta,\sigma^{2}) with known σ2\sigma^{2} and let 0<α<10<\alpha<1. Then there is no critical region C∗C^{*} with βC∗⁢(θ0)≤α\beta_{C^{*}}(\theta_{0})\leq\alpha such that βC∗⁢(θ)≥βC′⁢(θ)\beta_{C^{*}}(\theta)\geq\beta_{C^{\prime}}(\theta) for all θ≠θ0\theta\neq\theta_{0} and any critical region C′C^{\prime} with βC′⁢(θ0)≤α\beta_{C^{\prime}}(\theta_{0})\leq\alpha.

Proof.

Suppose that C∗C^{*} were such a region, and fix some θ1>θ0\theta_{1}>\theta_{0}. Then C∗C^{*} is most powerful at level α\alpha for testing θ0\theta_{0} against θ1\theta_{1}, and so is the region C+={x¯>cα}C_{+}=\{\bar{x}>c_{\alpha}\} of example 22.3. The boundary set {x¯=cα}\{\bar{x}=c_{\alpha}\} has probability zero, and thus by the second statement of theorem 22.2 the regions C∗C^{*} and C+C_{+} differ only on a set which has probability zero for every θ\theta. Consequently the two tests have the same power function, βC∗⁢(θ)=β+⁢(θ)\beta_{C^{*}}(\theta)=\beta_{+}(\theta) for all θ\theta. Now take any θ2<θ0\theta_{2}<\theta_{0}. From the formulas of section 22.4 we get

βC∗⁢(θ2)=β+⁢(θ2)<1−Φ⁢(z1−α)=α<β−⁢(θ2),\beta_{C^{*}}(\theta_{2})=\beta_{+}(\theta_{2})<1-\Phi(z_{1-\alpha})=\alpha<% \beta_{-}(\theta_{2}),

since Φ\Phi is strictly increasing and n⁢(θ2−θ0)/σ<0\sqrt{n}\,(\theta_{2}-\theta_{0})/\sigma<0. The left-sided test C−={x¯<θ0−z1−α⁢σ/n}C_{-}=\{\bar{x}<\theta_{0}-z_{1-\alpha}\sigma/\sqrt{n}\} has size α\alpha and thus is an admissible competitor C′C^{\prime}, and it has strictly larger power at θ2\theta_{2} than C∗C^{*}. This contradicts the assumed property of C∗C^{*}, which completes the proof. ∎

The argument is not particular to the normal distribution: whenever the one-sided most powerful regions disagree, a uniformly most powerful two-sided test would have to coincide with both, which is impossible, and so we have to settle for a compromise. The two-sided test in example 20.7 is such a compromise: the power of this test is less than β+⁢(θ)\beta_{+}(\theta) for θ>θ0\theta>\theta_{0}, but it is strictly larger than α\alpha for all θ≠θ0\theta\neq\theta_{0}. In lecture 23 we will see that this test is the result of applying the likelihood principle to a composite alternative. The generalised likelihood-ratio test obtained in this way is a general-purpose tool which can be used when no uniformly most powerful test exists.

Summary.
  • •
    ​

    A test is most powerful at level α\alpha for a simple null hypothesis against a simple alternative, if it has level α\alpha and no other test of level α\alpha has larger power.

  • •
    ​

    The Neyman–Pearson lemma: The test which rejects when f⁢(x;θ1)>k⁢f⁢(x;θ0)f(x;\theta_{1})>k\,f(x;\theta_{0}), where kk is chosen so that the size is α\alpha, is most powerful at level α\alpha. Any other most powerful test coincides with this test outside the boundary set. The proof involves integration of (𝟏C−𝟏C′)⁢(f⁢(x;θ1)−k⁢f⁢(x;θ0))≥0(\mathbf{1}_{C}-\mathbf{1}_{C^{\prime}})(f(x;\theta_{1})-k\,f(x;\theta_{0}))\geq 0.

  • •
    ​

    In practice, R⁢(x)>kR(x)>k can be rewritten as T⁢(x)>cT(x)>c for a simple statistic TT and cc can be found by considering the distribution of TT under H0H_{0}; for the normal mean this gives X¯>θ0+z1−α⁢σ/n\bar{X}>\theta_{0}+z_{1-\alpha}\sigma/\sqrt{n}.

  • •
    ​

    If the region of acceptance does not depend on the alternative θ1\theta_{1}, the same test will be most powerful against all θ1>θ0\theta_{1}>\theta_{0}: the test is then uniformly most powerful for the one-sided problem.

  • •
    ​

    For the two-sided alternative, no uniformly most powerful test can exist, since the two one-sided tests disagree; instead, the likelihood-ratio tests from lecture 23 can be used.

Exercise 22.1.

Let X1,…,XnX_{1},\dots,X_{n} be i.i.d. Poisson with mean θ>0\theta>0 and let S=∑i=1nXiS=\sum_{i=1}^{n}X_{i}, Poisson with mean n⁢θn\theta. We test H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ=θ1H_{1}\colon\theta=\theta_{1} where θ1>θ0\theta_{1}>\theta_{0}.

  1. 1.
    ​

    Show that the likelihood ratio R⁢(x)R(x) is a strictly increasing function of s=∑ixis=\sum_{i}x_{i} and that the most powerful test rejects when S>cS>c. Why does cc not depend on θ1\theta_{1}? What are the consequences for testing against the composite alternative H1:θ>θ0H_{1}\colon\theta>\theta_{0}?

  2. 2.
    ​

    Let n=5n=5, θ0=1\theta_{0}=1 and α=0.05\alpha=0.05. Determine the smallest integer cc such that the test has size at most 0.050.05. Compute the actual size of the test for this value. You may use ℙ⁢(S≤8)=0.9319\mathbb{P}(S\leq 8)=0.9319 and ℙ⁢(S≤9)=0.9682\mathbb{P}(S\leq 9)=0.9682 for a Poisson random variable SS with mean 55.

  3. 3.
    ​

    Determine the power of the test at θ1=2\theta_{1}=2, using ℙ⁢(S≤9)=0.4579\mathbb{P}(S\leq 9)=0.4579 for a Poisson random variable with mean 1010.

  4. 4.
    ​

    Why cannot a test of the form {S>c}\{S>c\} have size exactly 0.050.05? At which level is the test from part (b) most powerful?

Exercise 22.2.

Let X1,…,XnX_{1},\dots,X_{n} be i.i.d. Bernoulli with success probability p∈(0,1)p\in(0,1), and let S=∑i=1nXiS=\sum_{i=1}^{n}X_{i}. In exercise 20.2 we tested H0:p=1/2H_{0}\colon p=1/2 against H1:p>1/2H_{1}\colon p>1/2 by rejecting for large values of SS.

  1. 1.
    ​

    For a fixed alternative p1>1/2p_{1}>1/2, show that the likelihood ratio is given by

    R⁢(x)=(p11−p1)s⁢(2⁢(1−p1))n,s=∑i=1nxi,R(x)=\Bigl{(}\frac{p_{1}}{1-p_{1}}\Bigr{)}^{s}\bigl{(}2(1-p_{1})\bigr{)}^{n},% \qquad s=\sum_{i=1}^{n}x_{i},

    and that it is strictly increasing in ss. Deduce that the most powerful test rejects when S>cS>c, and that the test of exercise 20.2 is uniformly most powerful against H1:p>1/2H_{1}\colon p>1/2.

  2. 2.
    ​

    Let n=20n=20. Using ℙ1/2⁢(S≥14)=0.0577\mathbb{P}_{1/2}(S\geq 14)=0.0577 and ℙ1/2⁢(S≥15)=0.0207\mathbb{P}_{1/2}(S\geq 15)=0.0207, find the critical region of the largest size not exceeding 0.050.05, and compute its power at p1=0.7p_{1}=0.7 using ℙ0.7⁢(S≤14)=0.5836\mathbb{P}_{0.7}(S\leq 14)=0.5836. Compare the size and the power with those found for n=10n=10 in exercise 20.2.

  3. 3.
    ​

    For an alternative p1<1/2p_{1}<1/2, find the most powerful critical region, and explain why the two one-sided problems lead to different tests.

Exercise 22.3.

Let X1,…,XnX_{1},\dots,X_{n} be i.i.d. uniformly distributed on the set (0,θ)(0,\theta), with joint density f⁢(x;θ)=θ−n⁢𝟏{m≤θ}f(x;\theta)=\theta^{-n}\mathbf{1}_{\{m\leq\theta\}} for x1,…,xn≥0x_{1},\dots,x_{n}\geq 0, where m=maxi⁡xim=\max_{i}x_{i}, and let M=maxi⁡XiM=\max_{i}X_{i}. From example 8.10 we know that ℙθ⁢(M≤y)=(y/θ)n\mathbb{P}_{\theta}(M\leq y)=(y/\theta)^{n} for 0≤y≤θ0\leq y\leq\theta. We want to test H0:θ=θ0H_{0}\colon\theta=\theta_{0} against H1:θ=θ1H_{1}\colon\theta=\theta_{1}, where θ1>θ0\theta_{1}>\theta_{0}, at significance level α∈(0,1)\alpha\in(0,1). In exercise 20.3 we have considered tests based on MM for this model, and in the following we will see that these tests are optimal.

  1. 1.
    ​

    Let k=(θ0/θ1)nk=(\theta_{0}/\theta_{1})^{n}. Determine the sets {x∣f⁢(x;θ1)>k⁢f⁢(x;θ0)}\{x\mid f(x;\theta_{1})>k\,f(x;\theta_{0})\} and {x∣f⁢(x;θ1)=k⁢f⁢(x;θ0)}\{x\mid f(x;\theta_{1})=k\,f(x;\theta_{0})\} in terms of mm.

  2. 2.
    ​

    Show that the critical region C={m>c}C=\{m>c\} for c=θ0⁢(1−α)1/nc=\theta_{0}(1-\alpha)^{1/n} has size α\alpha and satisfies the condition from theorem 22.2 for this kk. Conclude that this is the most powerful test at level α\alpha. Compute the power of the test and explain why the test is uniformly most powerful against H1:θ>θ0H_{1}\colon\theta>\theta_{0}.

  3. 3.
    ​

    Show that the region C′′={m>θ0}∪{m≤θ0⁢α1/n}C^{\prime\prime}=\{m>\theta_{0}\}\cup\{m\leq\theta_{0}\alpha^{1/n}\} also has size α\alpha and the same power as CC. Explain, using the second statement of theorem 22.2, why this does not contradict the theorem, even though the model has densities.

Exercise 22.4.

Let TT be a sufficient statistic for the model f⁢(x;θ)f(x;\theta) and let θ0≠θ1\theta_{0}\neq\theta_{1} be two parameter values. Using the factorisation theorem 8.2, show that the likelihood ratio R⁢(x)=f⁢(x;θ1)/f⁢(x;θ0)R(x)=f(x;\theta_{1})/f(x;\theta_{0}) depends on the data only through T⁢(x)T(x), for all xx where the denominator is positive.