Testing composite hypotheses Θ = Θ 0 Θ c 0 H 0 : θ Θ 0 H 1 : θ Θ c 0 Definition 16 A test φ is a uniformly most powerful (UMP) level α test for H 0 vs. H 1 if φ has level α and for any other level α test φ E θ [φ(x)] E θ [φ (X)] θ Θ c 0. Theorem 8 Let φ be the most powerful size α test of H 0 : θ = θ 0 vs. H 1 : θ = θ 1, where θ 0 Θ 0 and θ 1 Θ c 0. (φ is assumed to be of the form in a) of Neyman-Pearson lemma.) Suppose that 1) φ does not depend on θ 1, and 2) E θ [φ(x)] α θ Θ 0. Then φ is the UMP level α test of H 0 vs. H 1. 153
Proof 2) that φ is level α. Let φ be any other level α test of H 0 vs. H 1. Since φ does not depend on θ 1, it follows from the Neyman- Pearson lemma that E θ [φ(x)] E θ [φ (X)] θ Θ c 0 and any test φ such that E θ0 [φ (X)] α. But φ is of this form since it is level α for testing H 0 vs. H 1. The result follows immediately. Note In most cases where Theorem 8 is applied, θ 0 is chosen to be on the boundary between Θ 0 and Θ c 0. Example 33 Let X 1,..., X n be i.i.d. N(θ, 1) observations. Want to test H 0 : θ θ 0 vs. H 1 : θ > θ 0. Let θ 1 > θ 0. In Example 30 we found the most powerful size α test of H 0 : θ = θ 0 vs. H 1 : θ = θ 1 is φ(x) = { 1, x θ0 + z α / n 0, x < θ 0 + z α / n. 154
This test does not depend on θ 1. Does it have level α when used to test H 0 vs. H 1? Let θ < θ 0. P θ ( X θ 0 + z α n ) = P θ ( X θ 1/ n ) n(θ 0 θ) + z α = P (Z n(θ 0 θ) + z α ) < α since θ 0 > θ. This explains why θ 0 was used in H 0. In many cases the most powerful level α test of H 0 : θ = θ 0 vs. H 1 : θ = θ 1 (θ 1 > θ 0 ) will depend on θ 1. In such cases a UMP test for H 0 : θ θ 0 vs. H 1 : θ > θ 0 does not exist. However, there is a large class of distributions for which UMP tests do exist. 155
Let X 1,..., X n be i.i.d. observations with pdf or pmf p(x θ), θ Θ R. Define f(x θ) = p(x 1 θ) p(x n θ). Definition 17 The family of distributions {f(x θ) : θ Θ} is said to have the monotone likelihood ratio property in the statistic T (X) if for θ 1 < θ 2 the ratio f(x θ 2 )/f(x θ 1 ) is a nondecreasing function of T (x) on {x : f(x θ 1 ) > 0 or f(x θ 2 ) > 0}. Example 34 Let X 1,..., X n be i.i.d. U(0, θ) observations, where θ > 0. The joint pdf is f(x θ) = θ n I (0,x(n) ) (x (1) )I (0,θ) (x (n) ). 156
Let 0 < θ 1 < θ 2, and x be such that 0 < x (n) < θ 2. (Otherwise both densities are 0.) f(x θ 2 ) f(x θ 1 ) = { (θ1 /θ 2 ) n, 0 < x (n) < θ 1, θ 1 x (n) < θ 2. Hence, the family of U(0, θ) densities has MLR in T (X) = X (n). Theorem 9 family The one-parameter exponential f(x θ) = exp [c(θ)t (x) + d(θ) + S(x)] I A (x) has MLR in T when c is nondecreasing in θ. Proof Let θ 1 < θ 2 and x A. (Why do we assume x A?) 157
f(x θ 2 ) f(x θ 1 ) = exp {T (x)[c(θ 2) c(θ 1 )]+ d(θ 2 ) d(θ 1 )}. Since c(θ 1 ) c(θ 2 ), this is a nondecreasing function of T (x). Normal, Poisson, binomial, and exponential distributions all have the MLR property. Theorem 10 Let X 1,..., X n be i.i.d. observations with joint pdf f(x θ), θ Θ, and let the family {f(x θ) : θ Θ} have the MLR property in T. Let θ 0 Θ. Then for testing the composite hypotheses H 0 : θ θ 0 vs. H 1 : θ > θ 0 at level α, there exists a test which is UMP among all level α tests. The UMP test is φ(x) = 1, if T (x) > k γ, if T (x) = k 0, if T (x) < k 158
where k and γ are determined by α = E θ0 [φ(x)] = P θ0 [T (X) > k] + γp θ0 [T (X) = k]. Proof Roussas, p. 279; Lehmann, pp. 68-69; Casella and Berger, p. 391. Note The UMP test for H 0 : θ θ 0 vs. H 1 : θ < θ 0 in the situation of Theorem 10 is given by reversing the inequalities in the definition of φ. Example 35 Let X 1,..., X n be i.i.d. U(0, θ). From Example 34 {f(x θ) : θ > 0} has MLR in X (n). By Theorem 10 the UMP test of is H 0 : θ θ 0 vs. H 1 : θ > θ 0 φ(x) = { 1, if x(n) c 0, if x (n) < c, where E θ0 [φ(x)] = α = P θ0 (X (n) c). 159
P θ0 (X (n) c) = 1 P θ0 (X 1 < c,..., X n < c) = 1 [P (X 1 < c)] n = 1 ( c θ 0 ) n The last quantity is α iff c = θ 0 (1 α) 1/n. For θ > θ 0 (1 α) 1/n, the power curve is β(θ) = P θ (X (n) c) = 1 [ θ0 θ (1 α)1/n ] n = 1 ( θ0 θ ) n (1 α). For θ θ 0 (1 α) 1/n, β(θ) = 0. Note: As θ, β(θ) 1. 160
Example 36 Let X 1,..., X n be i.i.d. N(0, θ). Θ = {θ : θ > 0}. Find UMP test of H 0 : θ θ 0 vs. H 1 : θ < θ 0. Defining η = 1/θ and η 0 = 1/θ 0, these hypotheses are equivalent to H 0 : η η 0 vs. H 1 : η > η 0. Check for the MLR property. f(x η) = exp η 2 n i=1 x 2 i n 2 log(2πη 1 ) Since η/2 is an increasing function of η, Theorems 9 and 10 tell us that the UMP level α test of H 0 vs. H 1 has the form φ(x) = { 1, if ni=1 x 2 i c 0, if n i=1 x 2 i < c. 161
The test on the last page can also be written { 1, if ni=1 x 2 φ(x) = i c 0, if n i=1 x 2 i > c. The constant c is such that P η0 ( n i=1 X 2 i c ) = α. When η = η 0, we know that η 0 X i N(0, 1), and so η 0 X 2 i χ 2 1 and η 0 ni=1 X 2 i χ 2 n. It follows that c = χ 2 n,α/η 0, where χ 2 n,p is the 100pth percentile of the χ 2 n distribution. So, we have found the most powerful level α test of H 0 vs. H 1, and hence of H 0 vs. H 1. β(θ) = P θ [ χ 2 n ( θ0 θ ) ] χ 2 n,α Limiting cases: θ = 0 and θ =. 162
Example 37: UMP tests do not always exist Let the probability model be as in Example 36. Want to test H 0 : θ = θ 0 vs. H 1 : θ θ 0. Θ 0 = {θ 0 } Θ c 0 = (0, ) {θ 0} c MP test of H 0 : θ = θ 0 vs. H 1 : θ = θ 1 for θ 1 > θ 0 is { 1, if ni=1 x 2 φ 1 (x) = i c 0, if n i=1 x 2 i < c. MP test of H 0 : θ = θ 0 vs. H 1 : θ = θ 2 for θ 2 < θ 0 is { 1, if ni=1 x 2 φ 2 (x) = i c 1 0, if n i=1 x 2 i > c 1. Assume φ is UMP for testing H 0 vs. H 1. Then it is most powerful for H 0 : θ = θ 0 vs. H 1 : θ = θ 1 and hence agrees with φ 1 by N-P lemma. Also, it must agree with φ 2 by the same logic. But φ 1 φ 2, which yields a contradiction. Hence, there is no UMP test. 163
When a UMP test doesn t exist, one can look at a smaller class of tests and try to find the most powerful test within the smaller class. Examples of such tests: (i) Class of unbiased tests A test is said to be unbiased if β(θ) size of test for all θ Θ c 0. (ii) Class of invariant tests See pp. 213-222 of Lehmann, Testing Statistical Hypotheses. 164
Likelihood ratio tests Neyman-Pearson says that the most powerful level α test of H 0 : θ = θ 0 vs. H 1 : θ = θ 1 rejects H 0 for large values of f(x θ 1 ) f(x θ 0 ) = L(θ 1 x) L(θ 0 x). The test statistic is a ratio of likelihoods. Extend this notion to testing composite hypotheses. Let X 1,..., X n be observations with joint pdf f(x θ), θ Θ = Θ 0 Θ c 0, and consider sup θ Θ c 0 L(θ x) sup θ Θ0 L(θ x). The numerator is the likelihood function at the most plausible value of θ in Θ c 0. Likewise, the denominator is L at the most plausible value of θ in Θ 0. 165
It seems reasonable to test H 0 : θ Θ 0 vs. H 1 : θ Θ c 0 by rejecting H 0 if and only if the likelihood ratio on the previous page is sufficiently large. In practice, the test statistic most often used is λ(x), where λ(x) = sup θ Θ L(θ x) sup θ Θ0 L(θ x). Define and L(Θ 0 ) = sup θ Θ 0 L(θ x) L(Θ c 0 ) = sup θ Θ c L(θ x). 166
λ(x) = max ( L(Θ 0 ), L(Θ c 0 )) L(Θ 0 ) ( ) L(Θ c = max 0 ) L(Θ 0 ), 1. The likelihood ratio test is { 1, λ(x) > c φ L (x) = 0, λ(x) < c, where c is chosen so that E θ [φ L (X)] α for all θ Θ 0. Note that λ(x) 1 for all x. Recall that under general conditions MLEs are consistent. If H 0 is true, the MLE ˆθ will be close to H 0. If ˆθ Θ 0, then λ(x) = 1, and we won t reject H 0. When ˆθ Θ c 0 and far enough from Θ 0, then we will reject H 0. 167
To calculate λ(x) we need ˆθ, the MLE of θ, and the restricted MLE ˆθ R, where L(ˆθ R x) = sup θ Θ 0 L(θ x). Usually we try to find a statistic T (X) such that λ(x) is a monotone function of T (x). The likelihood ratio test can then be formulated in terms of T (x). Likelihood ratio tests are especially useful in two situations: (i) Two-sided tests (ii) Tests in the presence of nuisance parameters 168
Example 38: Two-sided test X 1,..., X n is a random sample from N(0, θ). H 0 : θ = θ 0 vs. H 1 : θ θ 0 The unrestricted MLE of θ is ˆθ = n i=1 Xi 2/n, and, trivially, the restricted MLE of θ is θ 0. [ L(ˆθ x) L(θ 0 x) = (2πˆθ) n/2 exp ni=1 x 2 i /(2ˆθ) ] (2πθ 0 ) n/2 exp [ n i=1 x 2 i /(2θ 0) ] Now, = ( θ0ˆθ ) n/2 exp [ n 2 + nˆθ 2θ 0 log(λ(x)) = n 2 log(θ 0/ˆθ) n 2 (1 ˆθ/θ 0 ) ] = n 2 [ log(ˆθ/θ 0 ) + (1 ˆθ/θ 0 ) ]. 169
Define g(y) = [log y + (1 y)]. We have g (y) = 1 y + 1, and hence g (y) < 0 for y < 1 and g (y) > 0 for y > 1. So, log λ(x) > c iff ˆθ/θ 0 < c 1 or ˆθ/θ 0 > c 2, where c 1 and c 2 are such that g(c 1 ) = g(c 2 ). We also know that n(ˆθ/θ 0 ) χ 2 n when θ = θ 0. The precise likelihood ratio test is thus φ L (x) = { 1, ˆθ θ 0 c 1 or ˆθ θ 0 c 2 0, θ 0 c 1 < ˆθ < θ 0 c 2, where g(c 1 ) = g(c 2 ) and P (χ 2 n nc 1) + P (χ 2 n nc 2) = α. 170