13.02.2014 Views

Solution to Homework #12 - Statistics

Solution to Homework #12 - Statistics

Solution to Homework #12 - Statistics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Homework</strong> <strong>#12</strong> solutions<br />

Stat 530, Spring 2010<br />

1. #8.15 We can use the Neymann-Pearson lemma because H 0 and H 1 are simple. Recall<br />

from a previous problem (and the second exam) that T = ∑ n<br />

i=1 X 2 i is sufficient for σ 2 ,<br />

and we also know that T/σ 2 ∼ χ 2 (n), because the X i /σ are independent standard normal<br />

random variables.<br />

Therefore<br />

and<br />

g(t|σ 2 ) = 1 σ 2 1<br />

Γ(n/1)2 n/2 ( t<br />

σ 2 ) n/2−1<br />

e −t/(2σ2 )<br />

g(t|σ1)<br />

2 ( ) σ<br />

2 n/2−1 {<br />

g(t|σ0) = 0<br />

exp − 1 (<br />

n∑ 1<br />

x 2 2 σ1<br />

2 i − 1 )}<br />

.<br />

2<br />

i=1<br />

σ1<br />

2 σ0<br />

2<br />

A test that is UMP will reject H 0 if this ratio is “large” which is equivalent <strong>to</strong> rejecting<br />

H 0 when ∑ n<br />

i=1 x 2 i is “small,” as was <strong>to</strong> be shown. If α = 0.05, say, then we find c so that<br />

or<br />

P<br />

( n<br />

)<br />

∑<br />

P Xi 2 > c|σ0<br />

2 = .05,<br />

i=1<br />

( n ∑<br />

i=1<br />

( ) 2 Xi<br />

> c )<br />

|σ 2<br />

σ 0 σ0<br />

2 0 = .05,<br />

so we choose c = σ 2 0q, where q is the 95th percentile of a χ 2 (n) density.<br />

2. #8.19 if Y = X θ , then the pdf for Y is<br />

f Y (y) = 1 θ e−y1/θ y 1/θ−1<br />

For the simple test H 0 : θ = 1 vs H 1 : θ = 2, the ratio of densities is<br />

R = f(y|2)<br />

f(y|1) = ey−√ y<br />

2 √ y<br />

which is “large” when y is large or small (away from 1). We find k such that P θ=1 (R ><br />

k) = .10 numerically (if you can think of a cleverer way, let me know). We find k = 1.4793,<br />

and the power is P θ=2 (R > k) = .3902. These ideas are illustrated in the plot below. In<br />

plot (a), R is plotted against y, and we see k, c 1 , and c 2 . In plot (b), the shaded area is<br />

0.10, and in plot (c), the shaded area is 0.3902. Note the scales are different!


Another note: Clearly there are lots of different size-α tests for this problem. This test<br />

does not have “equal probability tails” but we know that if we choose the size-α test that<br />

does, it will have lower power.<br />

(a)<br />

(b)<br />

(c)<br />

R<br />

1 2 3 4 5 6<br />

k<br />

c1<br />

c2<br />

0 1 2 3 4 5<br />

exp(-yp)<br />

0.0 0.2 0.4 0.6 0.8 1.0<br />

c1<br />

c2<br />

0 1 2 3 4 5<br />

exp(-sqrt(yp))/2/sqrt(yp)<br />

0 1 2 3 4 5 6<br />

c1<br />

c2<br />

0 1 2 3 4 5<br />

Y<br />

yp<br />

yp<br />

3. #8.20 The possible values of the ratio of the distributions are 6, 5, 4, 3, 2, 1, .79/.94, for x<br />

values 1 through 7, respectively. We reject H 0 when the ratio is “large”, and if we want<br />

α = .04, our decision rule is: reject H 0 when x ≤ 4. Then the power is P (X ≤ 4|H 1 ) = .18.<br />

4. #8.22 Let Y = ∑ 10<br />

i=1 X i , and note that Y is suffiecient for p. (a) We can compute<br />

f(y|p = 1/4)<br />

f(y|p = 1/2) = 3−y (3/2) 10 ,<br />

so we reject when y is “small.” (We already did this for the likelihood ratio test, but<br />

now we know it is UMP.) The probability that Y ≤ 2, under H 0 , is 0.0547. The power is<br />

P (Y ≤ 2|H 1 ) = .526.<br />

(b) P (Y ≥ 6) = .377 is the test size.<br />

power<br />

0.0 0.2 0.4 0.6 0.8 1.0<br />

0.0 0.2 0.4 0.6 0.8 1.0<br />

p


(c) The possible levels of α correspond <strong>to</strong> the possible decision rules. All decision rules<br />

corresponding <strong>to</strong> UMP tests are of the form: reject H 0 when Y ≥ k, and for k = 1, . . . , 10,<br />

the test sizes are 0.999, 0.989, 0.945, 0.828, 0.623, 0.377, 0.172, 0.055, 0.011, 0.001.<br />

5. #8.25 (a) Choose any θ 1 < θ 2 . Then the likelihood ratio is<br />

f(t|θ 2 )<br />

f(t|θ 1 )<br />

which is increasing in t.<br />

{<br />

= exp − 1 [<br />

(t − θ2 ) 2 − (t − θ<br />

2σ 2 1 ) 2]}<br />

{<br />

= exp − 1 [ ] } {<br />

θ<br />

2 1<br />

2σ 2 2 − θ1<br />

2 exp<br />

σ t(θ 2 2 − θ 1 )}<br />

(b) Choose any θ 1 < θ 2 . Then the likelihood ratio is<br />

f(t|θ 2 )<br />

f(t|θ 1 )<br />

= e−θ2 θ2/t!<br />

t<br />

e −θ1 θ1/t!<br />

t ( ) t<br />

= e −(θ 2−θ 1 ) θ2<br />

θ 1<br />

which is increasing in t.<br />

(c) Choose any θ 1 < θ 2 . Then the likelihood ratio is<br />

f(t|θ 2 )<br />

f(t|θ 1 )<br />

=<br />

(<br />

n<br />

t<br />

(<br />

n<br />

t<br />

)<br />

)<br />

θ t 2(1 − θ 2 ) n−t<br />

θ t 1(1 − θ 1 ) n−t<br />

=<br />

( ) n ( ) t<br />

1 − θ2 θ2 (1 − θ 1 )<br />

1 − θ 1 θ 1 (1 − θ 2 )<br />

which is increasing in t.<br />

6. #8.31 We showed previously that the sum T = ∑ n<br />

i=1 X i is sufficient for λ, and that T is<br />

Poisson with mean nλ. Hence, by the previous problem, the family {g(t|λ) has MLR, so<br />

that a UMP level-α test is of the form: reject H 0 iff T > t 0 . For example, if n = 20 and<br />

if we want α ≈ .01, we reject H 0 if T > 79, and α = .00782.<br />

7. #8.34 (a) If g(t|θ) = h(t − θ), then<br />

P θ1 (T > c) =<br />

∫ ∞<br />

c<br />

g(tθ 1 )dt


=<br />

=<br />

∫ ∞<br />

c<br />

∫ ∞<br />

h(t − θ 1 )dt<br />

c−θ 1<br />

h(u)du<br />

∫ ∞<br />

≥ h(u)du<br />

c−θ 2<br />

≥ P θ2 (T > c)<br />

where the first inequality is because θ 2 > θ 1 and h(u) ≥ 0.<br />

(b) Suppose the family has increasing MLR, and consider θ 1 > θ 0 . By the the Neymann-<br />

Pearson lemma, the test that rejects H 0 if g(t|θ 1 )/g(t|θ 0 ) > k is a UMP level-α test where<br />

α = P θ0 (g(t|θ 1 )/g(t|θ 0 ) > k). Because the ratio g(t|θ 1 )/g(t|θ 0 ) is mono<strong>to</strong>ne increasing<br />

in t, this test is equivalent <strong>to</strong>: reject H 0 if T > t 0 , where α = P θ0 (T > t 0 ). Then the<br />

corollary <strong>to</strong> the Neymann-Pearson lemma says that the power is larger than the test size,<br />

so P θ1 (T > t 0 ) > P θ0 (T > t 0 ) which was what we wanted.<br />

8. #8.37 (a) Consider the sufficient statistic T = ¯X. Using T , we get that the likelihood<br />

ratio is<br />

λ(t) = sup 1<br />

θ≤θ 0<br />

e − 1<br />

2πσ 2 2σ 2 (t−θ)2<br />

1<br />

sup θ e − 1<br />

2πσ 2 2σ 2 (t−θ)2<br />

We know that the MLE for θ is t, so if t = ¯x ≤ θ 0 , λ(t) = 1 and we accept H 0 . If ¯x > t,<br />

then the maximum of the numera<strong>to</strong>r occurs at θ 0 , and we get: reject H 0 if<br />

e − 1<br />

2σ 2 (t−θ 0) 2<br />

is large, which occurs when t−θ 0 is large. Therefore, we get the same test in the likelihood<br />

ratio approach.<br />

(b) We showed in a previous problem that the family g(¯x|θ) has increasing MLR, so we<br />

reject H 0 when T > t 0 for the UMP level-α test.<br />

(c) For unknown σ 2 , we write the likelihood ratio as<br />

λ(x) =<br />

) n<br />

2<br />

exp{− 1 ∑ ni=1<br />

(x<br />

2πˆσ 0<br />

2 2ˆσ 0<br />

2 i − ˆθ 0 ) 2 }<br />

( ) n<br />

1 2<br />

exp{− 1 ∑ ni=1<br />

(x<br />

2πˆσ 2 2ˆσ 2 i − ˆθ)<br />

.<br />

2 }<br />

( 1<br />

when ¯x ≤ θ 0 , the ratio is 1, but when ¯x > θ 0 , we have ˆθ 0 = θ 0 and<br />

ˆσ 0 2 = 1 n∑<br />

(x i − θ 0 ) 2 ,<br />

n<br />

i=1


while ˆθ = ¯x and ˆσ 2 = ∑ n<br />

i=1 (x i − ¯x) 2 . Then<br />

λ(x) =<br />

[ ∑ ni=1<br />

(x i − ¯x) 2 ] n<br />

2<br />

∑ ni=1 .<br />

(x i − θ 0 ) 2<br />

The null hypothesis is rejected when this is small, or when<br />

∑ ni=1<br />

(x i − θ 0 ) 2<br />

∑ ni=1<br />

(x i − ¯x) 2<br />

is large. This can be written as<br />

∑ ni=1<br />

(x i − ¯x) 2 + n(¯x − θ 0 ) 2<br />

∑ ni=1<br />

(x i − ¯x) 2 = 1 + n(¯x − θ 0) 2<br />

so we can reject H 0 when<br />

(¯x − θ 0 ) 2<br />

is large. This is when<br />

¯x − θ 0<br />

S<br />

is large or small, which leads <strong>to</strong> the t-test.<br />

9. #8.41 (a) The likelihood is<br />

L(µ X , µ Y , σ 2 |x, y) =<br />

S 2<br />

(n − 1)S 2<br />

( ) 1 (n+m)/2<br />

{<br />

exp − 1 [<br />

∑ n<br />

(x<br />

2πσ 2 2σ 2 i − µ x ) 2 +<br />

i=1<br />

]}<br />

m∑<br />

(y i − µ y ) 2<br />

i=1<br />

Taking the log, partial derivatives with respect <strong>to</strong> the three parameters, and setting <strong>to</strong><br />

zero, etc., gives the usual MLEs:<br />

ˆµ x = 1 n∑<br />

x i = ¯x,<br />

n<br />

i=1<br />

ˆµ y = 1 m∑<br />

y i = ȳ,<br />

m<br />

i=1<br />

and<br />

ˆσ 2 = 1 [ n<br />

]<br />

∑<br />

m∑<br />

(x i − ¯x) 2 + (y i − ȳ) 2 .<br />

m + n<br />

i=1<br />

i=1<br />

Restricting µ x = µ y = µ, the MLE for µ is<br />

ˆµ 0 =<br />

∑ ni=1<br />

x i + ∑ m<br />

i=1 y i<br />

m + n


and for σ 2 we get<br />

Then the likelihood ratio is<br />

[ ] m+n {<br />

ˆσ<br />

2 2<br />

λ(x, y) = exp<br />

=<br />

ˆσ 2 0<br />

[ ˆσ<br />

2<br />

ˆσ 2 0<br />

] m+n<br />

2<br />

.<br />

ˆσ 0 2 = 1 [<br />

∑ n<br />

(x i − ˆµ 0 ) 2 +<br />

m + n<br />

i=1<br />

− 1<br />

2ˆσ 2 0<br />

[ n ∑<br />

(x i − ˆµ 0 ) 2 +<br />

i=1<br />

]<br />

n∑<br />

(y i − ˆµ 0 ) 2<br />

i=1<br />

]<br />

m∑<br />

(y i − ˆµ 0 ) 2 + 1 [ n<br />

]}<br />

∑<br />

m∑<br />

(x<br />

i=1<br />

2ˆσ 2 i − ¯x) 2 − (y i − ȳ) 2<br />

i=1<br />

i=1<br />

Now,<br />

(m + n)ˆσ 0 2 =<br />

n∑ m∑<br />

x 2 i + yi 2 − 2(n¯x + mȳ)ˆµ 0 + (m + n)ˆµ 2 0<br />

i=1 i=1<br />

=<br />

n∑<br />

n∑<br />

(x i − ¯x) 2 + n¯x 2 + (y i − ȳ) 2 + mȳ 2 − 2(n¯x + mȳ)ˆµ 0 + (m + n)ˆµ 2 0<br />

i=1<br />

i=1<br />

= (m + n)ˆσ 2 + n¯x 2 + mȳ 2 (mȳ + n¯x)2<br />

−<br />

m + n<br />

= (m + n)ˆσ 2 + mn<br />

m + n (¯x − ȳ)2 .<br />

So,<br />

ˆσ 0<br />

2<br />

ˆσ = 1 + mn ( ) ¯x − ȳ 2<br />

.<br />

2 (m + n) 2 ˆσ<br />

Then λ(x, y) is small when |¯x − ȳ|/ˆσ is large, and ˆσ 2 is proportional <strong>to</strong> Sp.<br />

2<br />

(b) Because under H 0 , the X i and Y i values are iid, we have shown that Sp 2 is an unbiased<br />

estima<strong>to</strong>r of σ 2 and (m + n − 2)Sp/σ 2 2 ∼ χ 2 (n + m − 2). We also know that (¯x − ȳ) is<br />

normal with mean zero and variance (1/m + 1/n)σ 2 . Therefore,<br />

¯x − ȳ<br />

Z =<br />

∼ N(0, 1).<br />

√(1/m + 1/n)σ2 We also showed that ¯X and ∑ n<br />

i=1 (X i − ¯X) 2 are independent and dit<strong>to</strong> for the Y -values,<br />

so that Z and S 2 p are independent. Then<br />

T =<br />

Z<br />

√<br />

(m + n − 2)S<br />

2<br />

p /σ 2 /(m + n − 2)<br />

∼ t(m + n − 2).<br />

(c) If the “core” measurements are the x i and the “periphery” measurements are the y i ,<br />

then I get ¯x = 1249.857 and ȳ = 1261.333 and S 2 p = 433.13, so the observed value of the<br />

T statistic is t = −1.291, and te p-value is .21. We accept H 0 and conclude there the<br />

means are the same.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!