Korea University, Department of Statistics STAT232 Mathematical Statistics – Assignment 7 Due date: 06/08/2022 1. You are told that a coin has probability of a Head either p = 34 or p = 14 . You must test H0 : p = 3 4 vs. Ha : p = 1 4 You toss the coin 3 times and get Y Heads. You decide to reject H0 in favor of Ha if Y = 0 or Y = 1. (Note that the count of Heads Y is the CSS for p.) What are the two error probabilities ↵ and for this test? What is the power of this test at the alternative Ha ? Sol) Y ⇠ Bin(3, p) ⇣ 3⌘ ↵ = P (reject H0 |H0 is true) = Y = 0 or 1 | p = 4 ✓ ◆ ✓ ◆ ✓ ◆ 1 ⇣ ⌘ ⇣ ⌘ ⇣ ⌘ ⇣ ⌘ X 3 3 y 1 3 y 3 3 0 1 3 3 ⇣ 3 ⌘1 ⇣ 1 ⌘2 = = + y 4 4 0 4 4 1 4 4 y=0 = 5 32 ⇣ 1⌘ = P (not reject H0 |Ha is true) = P Y = 2 or 3 | p = 4 ✓ ◆⇣ ⌘ ⇣ ⌘ ✓ ◆⇣ ⌘ ⇣ ⌘ 3 ✓ ◆⇣ ⌘ ⇣ ⌘ X y 3 y 2 1 3 1 3 3 1 3 3 1 3 3 0 = = + y 4 4 2 4 4 3 4 4 y=2 = 5 32 power = 1 = 27 32 2. In the setting of the previous problem, small values of Y are evidence against H0 in favor of the alternative hypothesis Ha . What is the P -value when you observe Y = 2? 1 When you observe Y = 1? Sol) p-value when (Y = 2) = P (Y 2|H0 is true) =1 =1 P (Y = 3|H0 is true) ✓ ◆⇣ ⌘ ⇣ ⌘ 3 3 3 1 0 37 = 3 4 4 64 p-value when (Y = 1) = P (Y 1|H0 is true) = P (Y = 0|H0 is true) + P (Y = 1|H0 is true) ✓ ◆⇣ ⌘ ⇣ ⌘ ✓ ◆⇣ ⌘ ⇣ ⌘ 3 3 0 1 3 3 3 1 1 2 = + 0 4 4 1 4 4 5 = 32 3. You observe a random sample Y1 , Y2 , · · · , Y8 from a Poisson distribution with unknown mean . You want to test H0 : vs. = 0.5 You decide to reject H0 in favor of Ha if V that V is the CSS for .) Ha : > 0.5 8, where V is the sum of Y1 to Y8 . (Note (a) What is the level ↵ of this test? (Hint : What is the distribution of a sum of independent Poisson variables?) t Sol) When Yi ⇠ P oisson( ), mgf MY (t) = e (e 1) . P t Then, mgf of V (= 8i=1 Yi ) is MV (t) = e8 (e 1) and therefore V ⇠ P oisson(8 ) ↵ = P (reject H0 |H0 is true) = P (V =1 7 X e 4 4v v=0 v! =1 2 8|8 = 4) 0.949 = 0.051 (b) What is the power of this test at = 0.75? At = 1.0? At Poisson table in Appendix to give numerical answers.) = 1.25? (Use the Sol) power = P (V 8 > > 1 > < = 1 > > > :1 8| ) = 1 7 X e v=0 v v! 0.744 = 0.256, = 0.75 0.453 = 0.547, = 1.0 0.220 = 0.780, = 1.25 4. In the setting of the previous problem, large values of V are evidence against H0 in favor of Ha . What is the P -value if you observe V = 4? If you observe V = 10? Sol) Under H0 , V ⇠ P oisson(4). p-value when (V = 4) = P (V =1 3 X e 4 4v =1 9 X e 4 4v =1 v=0 p-value when (V = 10) = P (V =1 4| = 0.5) v=0 v! 0.433 = 0.567 10| = 0.5) v! 0.992 = 0.008 5. A certain size bag is designed to hold 25 pounds of potatoes. A farmer fills such bags in the field. Assume that the weight Y of potatoes in a bag follows N (µ, 9). We would like to test H0 : µ = 25 vs. Ha : µ < 25. Let Y1 , Y2 , Y3 , Y4 be a random sample of size 4 from this distribution, and let the rejection region for this test is {Ȳ 22.5}. (a) What is the significance level of this test? Sol) ↵ = P (reject H0 |H0 is true) = P (Ȳ 22.5|µ = 25) ✓ ◆ ✓ ◆ 22.5 25 5 p = = = 0.0478 3 3/ 4 where (·) is the cdf of the standard normal distribution. 3 (b) What is the power of this test when µ = 23? Sol) power at (µ = 23) = P (Ȳ 22.5|µ = 23) = P ✓ ◆ 1 = = 0.3694 3 ✓ 22.5 23 p Z 3/ 4 ◆ where Z is a random variable following N (0, 1). (c) Suppose we observe y1 = 22, y2 = 24.5, y3 = 23, y4 = 26.5. What is the P -value associated with this sample? Sol) Ȳ = 24, n = 4 p-value = P (Ȳ 24|µ = 25) ✓ ◆ 24 25 p =P Z 3/ 4 ✓ ◆ 2 = = 0.2525 3 6. You have one observation Y , which has one of the pdf’s 3 f0 (y) = y 1/2 2 4 f1 (y) = y 1/3 3 0y1 0y1 Find the most powerful rejection region of level ↵(0 < ↵ < 1 given) for testing H0 : f0 is true vs. 4 Ha : f1 is true Sol) Using Neyman-Pearson Lemma, 1 3 2 y L(✓0 ) f0 (y) 9 1 = = 2 1 = y 6 , where 0 y 1 4 3 L(✓a ) f1 (y) 8 3y ⇢ ⇢ 1 9 1 8 6 Most Powerful Rejection Region = y < k = y6 < k 8 9 ( ✓ ◆6 ) ✓ ◆6 8 8 6 ⇤ ⇤ = y< k = {y < k }, k = k6 9 9 Z k⇤ 3 1 3 3 3 ⇤ ↵ = P (reject H0 |H0 is true) = y 2 dy = / y 2 |k0 2 2 2 0 3 = (k ⇤ ) 2 2 k⇤ = ↵ 3 2 ) MPRR = {y < ↵ 3 } 7. You have one observation Y , which has one of the discrete pdf’s y 0 1 2 3 4 5 6 f0 (y) 0.1 0.1 0.1 0.1 0.2 0.1 0.3 f1 (y) 0.3 0.1 0.1 0.2 0.1 0.1 0.1 You want to test H0 : f0 is true vs. Ha : f1 is true (a) Here is a test: reject H0 if Y = 0, 1, 2, 3, or 5. What are the probabilities of the two types of error for this test? What is the power of the test at the alternative? Sol) ↵ = P (reject H0 |H0 is true) = 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = 0.5 = P (not reject H0 |Ha is true) = 0.1 + 0.1 = 0.2 power = 1 = 0.8 5 (b) What is the most powerful test for H0 against Ha of level ↵ = 0.1? What is the most powerful test of level ↵ = 0.2? Sol) RR f0 /f1 13 f0 /f1 12 f0 /f1 1 f0 /f1 2 f0 /f1 3 Y 0 0, 3 0, 1, 2, 3, 5 0, 1, 2, 3, 4, 5 0, 1, 2, 3, 4, 5, 6 ↵ 0.1 0.2 0.5 0.7 1 MP test is the test that reject H0 if Y = 0 when ↵ = 0.1. MP test is the test that reject H0 if Y = 0 or 3 when ↵ = 0.2. 8. Let Y1 , · · · , Yn be a random sample from an exponential distribution with mean ✓. We would like to test H0 : ✓ = 3 against Ha : ✓ = 5 based on this random sample. (a) Find the form of the most powerful rejection region. Sol) 1 yi fYi (yi ) = e ✓ ✓ ✓ ◆n n Y 1 Pn 1 L(✓) = fYi (yi ) = e ✓ i=1 yi ✓ i=1 ✓ ◆n P ✓ ◆n n 1 1 L(✓0 ) ✓a 5 ) i=1 yi ( ✓0 ✓a = = e e L(✓a ) ✓0 3 n X RR : { yi k ⇤ } 2 Pn i=1 yi 15 i=1 n X Since Yi ⇠ exponential(✓) = Gamma(1, ✓), Under H0 , 2 Pn i=1 Yi ✓0 i=1 n = 2X Yi ⇠ 3 2 Yi ⇠ Gamma(n, ✓) (2n) i=1 n n X 2X ) M P RR = { Yi 3 2 2n,↵ } = { i=1 6 i=1 Yi 3 2 2 2n,↵ } (b) Suppose n = 12. Find the MP rejection region of level 0.1. Sol) n M P RR = { 2X Yi 3 2 24,0.1 } = { i=1 n X Yi 49.79437} i=1 (c) Is the rejection region in (b) the uniformly most powerful rejection region of level 0.1 for testing H0 : ✓ = 3 vs. Ha : ✓ > 3? Sol) Neither the test statistic nor the rejection region for this ↵-level test depends on the particular value assigned to ✓a . Thus, for any value of ✓a greater than ✓0 , we obtain exactly the same rejection region. ) It is the uniformly most powerful rejection region. (d) [not to be turned in] Find the likelihood ratio test of level ↵ for testing H0 : ✓ = 3 vs. Ha : ✓ 6= 3. Sol) L(✓) = n Y fYi (yi ) = i=1 ln L(✓) = n ln ✓ @ ln L(✓) = @✓ then, ✓ˆ = 1 n n Y 1 ✓ i=1 n X 1 ✓ n 1 + 2 ✓ ✓ n X e yi ✓ 1 e ✓n 1 Pn i=1 yi ✓ 2nȳ = ✓ˆ3 n < 0. ✓ˆ2 = yi i=1 n X let yi = 0 i=1 Yi = Ȳ i=1 2 @ n To be more rigorous, check @✓ ˆ = ˆ2 2 ln L(✓)|✓=✓ ✓ 7 Pn 1 y L(✓0 ) ✓0 n e ✓0 i=1 i = = 1 Pn ˆ L(✓) ✓ˆ n e ✓ˆ i=1 yi Pn 1 1 ȳ ȳ ) nȳ( ȳ3ȳ3 ) i=1 yi ( 3 ȳ = ( )n e = ( )n e 3 3 ȳ n n (ȳ 3) ȳ n n ȳ set n =( ) e 3 = e ( ) e 3 = g(ȳ) 3 3 ȳ n nt g(t) = ct e , where t = and c = en 3 let g 0 (t) = cntn 1 e nt + nctn e nt = 0 ȳ then t = = 1 provides the maximum value of g(t) since g 00 (t)|t=1 < 0. 3 n n X X Therefore, g(ȳ) < k where Yi c1 or Yi c2 Under H0 , 2 i=1 Pn i=1 Yi ✓0 = n 2X 3 i=1 i=1 2 Yi ⇠ (2n). Then the likelihood ratio test of level ↵ is the test which rejects H0 P P when ni=1 Yi 32 22n,1 ↵/2 or ni=1 Yi 32 22n,↵/2 . 9. Let Y1 , · · · , Yn be a random sample from N (0, 2 ). We would like to test H0 : against Ha : 2 > 02 based on this random sample. (a) Find the unifomly most powerful rejection region of level ↵. sol) L( L( 02 ) = L( 2 ) ✓ 2 2 0 2 2 ) = (2⇡ ◆n/2 exp X yi2 n 2 ) ✓ exp ✓ P Yi2 2 2 ◆ ◆X Yi2 c/ 2 )} where X 2 2 2 0 2 2 0 > 2 0 Yi2 / 2 ⇠ 2 for 2 P 2 Therefore the likelihood ratio is decreasing in Yi . The uniformly most powerful rejection region of level ↵ is C = {(y1 , · · · , yn : = {(y1 , · · · , yn : X then P c)} yi2 / 2 ⇣X Yi2 / 02 U M P RR = { 8 X 2 n,↵ |H0 Yi2 ⌘ =↵ 2 2 0 n,↵ } (n) 2 = 2 0 (b) [not to be turned in] Find the likelihood ratio test of level ↵ for testing H0 : 2 2 6= 2 0 vs. Ha : 0 sol) L( 2 ) = (2⇡ 2 ) n 2 exp ✓ P Yi2 ◆ 2 2 P 2 n Yi ln L( 2 ) = ln(2⇡ 2 ) 2 2 P 22 @ n Yi ln L( 2 ) = + =0 2 2 @ 2 2( 2 )2 1X 2 then ˆ 2 = Yi n P 2 @2 n Yi 2 Since ln L( ) = | 2 2 2 2 2 2 2 @( ) 2( ) ( )3 =ˆ P 2 1 n Yi n 1 = 2 2 | 2 =ˆ 2 = < 0, 2 ( ) 2 2 (ˆ 2 )2 ˆ 2 is the MLE of L( 02 ) = = L(ˆ 2 ) ✓ ˆ2 2 0 ◆n/2 exp 2 ✓ . n 2 ✓ ˆ2 2 0 ◆ n + 2 ◆ =g ✓ ˆ2 2 0 ◆ ⇣ n ⌘ ⇣n⌘ ˆ2 n/2 g(t) = ct exp t where t = 2 and c = exp 2 2 0 ⇣ n ⌘ ⇣ n ⌘ n n n n let g 0 (t) = c t 2 1 exp t c t 2 exp t =0 2 2 2 2 ⇣ ⌘ ⇣ ⇣ ⌘ n ⌘ n n n n n n g 00 (t) = c exp t t 2 nt 2 1 + 1 t2 2 2 2 2 2 Then t = Since and X ˆ2 00 2 = 1 provides the maximum value of g(t) since g (t)|t=1 < 0. 0 L( 02 ) is increasing where ˆ 2 / 02 < 1 and decreasing otherwise L(ˆ 2 ) Yi2 / 02 ⇠ 2 (n) under H0 , then the rejection region of level ↵ is X X 2 RR = { Yi2 / 02 2n,1 ↵/2 or Yi2 / 02 n,↵/2 } X X 2 2 ={ Yi2 02 2n,1 ↵/2 or Yi2 0 n,↵/2 } 9 2 =