Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
U.C. Berkeley — Stat 135 : Concepts of Statistics Professor: Noureddine El Karoui Homework 4 Due March 1 2007 Solutions for Homework 4 Problems Chapter 4: 17, 18 Chapter 9: 3, 4, 5, 9, 10, 11, 20 Problem 4.17 Referring to Example C in Section 3.7, we see that the density function of the kth order statistic is given by n! xk−1 (1 − x)n−k . (k − 1)!(n − k)! So we have X(k) ∼ Beta(k, n − k + 1) So the integrations have already been done for us: k n+1 k(n − k + 1) Var(X(k) ) = (n + 1)2 (n + 2) E(X(k) ) = Problem 4.18 Assume that X1 , ..., Xn are iid from a uniform distribution on (0,1). Assume that Z1 , ..., Zn are iid from a uniform distribution on (a,b). Then Zi = a + (b − a)Xi in distribution. So Z(i) = a + (b − a)X(i) in distribution. Therefore E(Z(n) − Z(1) ) = EZ(n) − EZ(1) = (b − a)(EX(n) − EX(1) ) = (b − a)(EX(n) − EX(1) ) = (b − a)( n−1 ) n+1 Where the last step follows from the previous problem. Problem 9.3 α is the probability that the test rejects the null hypothesis when it is true. Under H0 , X is Bin(100, .5), which is approximately N (50, 25). Thus, α = Pr0 (|X − 50| > 10) = Pr0 (|X − 50| > 10) = Pr0 (|X − 50|/5 > 2) ≈ 2Φ(−2) ≈ .046 1 Power is the probability that the test rejects the null hypothesis when it is false (1 minus the probability β of a Type II error). Under Ha , X is Bin(100, p), which is approximately N (100p, 100p(1 − p)). Thus, the power is 1 − β = PrA (|X − 50| > 10) = 1 − PrA (−10 ≤ X − 50 ≤ 10) = 1 − PrA (40 ≤ X ≤ 60) curve( 1 - ( pnorm(60, mean=100*x, sd=sqrt(100*x*(1-x))) pnorm(40, mean=100*x, sd=sqrt(100*x*(1-x))) ), xlab=’p’, ylab=’Power’ ) 0.6 0.2 0.4 Power 0.8 1.0 We are lazy and let R standardize X for us. 0.0 0.2 0.4 0.6 0.8 1.0 p Problem 9.4 The likelihood ratio is the likelihood of xi under H0 divided by the likelihood under H0 , i.e. Λ = Pr0 (X = xi )/PrA (X = xi ). Its distributions are given in the table below. X x4 x2 x1 x3 H0 .2 .3 .2 .3 HA .4 .4 .1 .1 Λ 1/2 3/4 2 3 Following the Neyman-Pearson paradigm, our test will reject H0 in favor of HA for small values of Λ. To construct a level α test we need find a critical value c such that the probability of a Type I error Pr0 (Λ ≤ c) = α 2 For α = .2 we see that the critical value c should be c = 1/2 because Pr0 (Λ ≤ 1/2) = .2 Similarly, for α = .5 the critical value is c = 3/4. Problem 9.5 a False. The null hypothesis is either true or false. The significance level is the probability that the test incorrectly rejects the null hypothesis when it is true. b False. Decreasing the significance level of a test makes it less likely to reject the null hypothesis. The power would be expected to decrease. c False. See (a). d False. That probability that the null hypothesis is falsely rejected is the significance level. e False. A type I error occurs when the test statistics falls in the rejection region of the test AND the null hypothesis is true. f False. A type I error is more serious than a type II error. g False. The power of a test is the probability that the null hypothesis is rejected when it is false. This probability is determined by the alternative distribution. h True. The likelihood ratio depends on the outcome of an experiment. 3 Problem 9.9 Suppose X1 , ..., X25 ∼ N (µ, 100) are iid. H0 : µ = µ0 = 0 H1 : µ = µA = 1.5 Since µA > µ0 we know from Example A on page 333 that the Likelihood Ratio is small when X̄ is big. This implies that we will reject our null hypothesis when X̄ > c for some constant c. Under the null, X̄ ∼ N (µ, 100 25 ) So X̄ = 2Z in distribution where Z is standard normal. Pr0 (Reject Null) = Pr0 (X̄ > c) = Pr(Z > c c ) = 1 − Φ( ) 2 2 Now define cα by α = 1 − Φ( c2α ), so we have an alpha level test. Let β = PrA (Accept Null) = PrA (X̄ < c) Under the alternative, Xi ∼ N (1.5, 100) so X̄ ∼ N (1.5, 4). This implies that X̄ = 1.5 + 2Z in distribution where Z is standard normal. Therefore, β = Pr(1.5 + 2Z < c) = Pr(Z < c − 1.5 ) 2 P OW ER(cα ) = 1 − βα = 1 − Φ( cα − 1.5 ) 2 Now looking at the normal table and plugging we see c.1 = 2.56 has power .2981 and c.01 = 4.66 has power .0571. Problem 9.10 By the factorization theorem, we can write f (x1 , ..., xn |θ) = g(t, θ) ∗ l(x1 , ..., xn ). So the likelihood ratio can be written as LR(x1 , ..., xn ) = g(T,θ0 ) g(T,θ1 ) Let h(T ) be the function on the RHS above. Then the likelihood ratio test would reject the null for h(T ) < c where c is chosen according to Pr0 (h(T ) < c) = α. If we know the distribution of T under the null, we may be able to calculate the distribution of h(T ) under the null as well. However, if h is a complicated function, it may be difficult. Instead, one might simulate M random variables with distribution T, calculate h(T) for each of them, then look at the proportion less than c for various values of c to pick the right significance level. If you made M very large, you could make this very accurate no matter how complicated the function h. Once you know the value of c, you look for the values of T such that h(T) is less than c. This is your rejection region for T. Problem 9.11 As in Example 9.4A, the rejection region for an α level test of this type is given by α |X̄| ≥ 2z( ) 2 4 Under the alternative with parameter µ, X̄ ∼ N (µ, 4), so X̄ = µ + 2Z in distribution where Z is a standard normal. Therefore, α α µ α µ α β(µ) = Prmu |X̄| ≤ 2z( ) = Pr |µ + 2Z| ≤ 2z( ) = Pr − − z( ) ≤ Z ≤ − + z( ) 2 2 2 2 2 2 We are asked to plot the power (1 − βµ ) for significance levels α = .1, .05. Looking at our normal table, we .05 see that z( .1 2 ) = 1.65 and z( 2 ) = 1.96 After that we are asked to increase our sample size. In that case, X̄ = µ + Z in distribution. Here is the code and the graphic: a = seq(-10,10,.05) par(mfrow=c(2,1)) plot( a, 1 - pnorm( -a/2 + 1.96, 0 , 1 ) + pnorm( -a/2 - 1.96 , 0 , 1), main="Sample size 25", type lines( a, 1 - pnorm( -a/2 + 1.65, 0 , 1 ) + pnorm( -a/2 - 1.65 , 0 , 1), lty=2 ) legend(x=0,y=.6, legend = c(".05 level", ".10 level"), lty=c(1,2)) plot( a, 1 - pnorm( -a + 2*1.96, 0 , 1 ) + pnorm( -a - 2*1.96 , 0 , 1), main="Sample size 100", type lines( a, 1 - pnorm( -a + 2*1.65, 0 , 1 ) + pnorm( -a - 2*1.65 , 0 , 1), lty=2 ) legend(x=0,y=.6, legend = c(".05 level", ".10 level"), lty=c(1,2)) 0.8 0.6 0.4 .05 level .10 level 0.2 1 − pnorm(−a/2 + 1.96, 0, 1) + pnorm(−a/2 − 1.96, 0, 1) 1.0 Sample size 25 −10 −5 0 5 10 5 10 a 0.8 0.6 0.2 0.4 .05 level .10 level 0.0 1 − pnorm(−a + 2 * 1.96, 0, 1) + pnorm(−a − 2 * 1.96, 0, 1) 1.0 Sample size 100 −10 −5 0 a 5 Problem 9.20 If x and c are positive, Then 1 2x < c iff 1 2c < x. So, to find c for a level α test, we note that Pr0 (Likelihood Ratio < c) = Pr0 ( Some algebra implies that the cα = 1 2(1−α) . 1 1 1 < c) = Pr0 ( < x) = 1 − 2x 2c 2c For our case, c = .9. Now, the power of this test is Z .9 2xdx = 1 − .81 = .19 1 − Pr1 (Don’t Reject) = 1 − Pr1 (X < .9) = 1 − 0 The Neyman-Person lemma tells us that no other test can do better. 6