Let X be a binomial random variable with n trials and probability p of

advertisement
Let X be a binomial random variable with n trials and probability p of success. a) What is the
generalized likelihood ratio for testing H0: p=0.5 versus Ha: p not equal to 0.5. b)Show that
the test rejects for large values of |X - (n/2)|. c) Using the null distribution of X, show how
the significance level corresponding to a rejection region |X-(n/2)| > k can be determined.
d) If n=10, k=2, what is the significance level of the test? e) Use the normal approximation
to the binomial distribution to find the significance level of n=100 and k=10
𝑛
𝑓(𝑥, 𝑝) = ( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 , 𝑥 = 0,1, … , 𝑛
𝑥
𝑛
𝑓(𝑥/0.5) = ( ) (0.5)𝑛
𝑥
Find the MLE of p
𝑙𝑛(𝑓) = 𝑐𝑜𝑛𝑠𝑡 + 𝑥 𝑙𝑛(𝑝) + (𝑛 − 𝑥) 𝑙𝑛(1 − 𝑝)
𝜕𝑙𝑛(𝑓) 𝑥 𝑛 − 𝑥
= −
=0
𝜕𝑝
𝑝 1−𝑝
𝑥(1 − 𝑝) − (𝑛 − 𝑥)𝑝 = 0
𝑥 − 𝑥𝑝 − 𝑛𝑝 + 𝑥𝑝 = 0
𝑥 − 𝑛𝑝 = 0
𝑝 = 𝑥/𝑛
Maximum of 𝑓(𝑥, 𝑝) with respect to 𝑝 is
𝑥 𝑛−𝑥
𝑛 𝑥 𝑥
𝑓(𝑥, 𝑥/𝑛) = ( ) ( ) (1 − )
, 𝑥 = 0,1, … , 𝑛
𝑥 𝑛
𝑛
Likelihood ratio is
𝑛
1 n
( ) (0.5)𝑛
(2)
𝑥
Λ= 𝑛
=
𝑥 𝑥
𝑥 𝑛−𝑥
𝑥 𝑥
𝑥 𝑛−𝑥
( ) (𝑛) (1 − 𝑛)
(𝑛) (1 − 𝑛)
𝑥
Let 𝑦 = 𝑥 − 𝑛/2 ⇒ 𝑥 = 𝑦 + 𝑛/2
Λ=
1 n
(2)
𝑦 + 𝑛/2 𝑦+𝑛/2
𝑦 + 𝑛/2 𝑛/2−𝑦
( 𝑛 )
(1 −
𝑛 )
1 n
(2)
=
1 𝑦 𝑦+𝑛/2 1 𝑦 𝑛/2−𝑦
( + )
( − )
2 𝑛
2 𝑛
Λ is an even function of y. Λ is maximum when 𝑦 = 0 and decreases as 𝑦 moves away from 0 to the left
or right. So Λ is smaller for large absolute values of 𝑦.
So the test rejects for large values of |𝑥 − 𝑛/2|
Under the null hypothesis the pdf of 𝑋 is
𝑛
𝑓(𝑥/0.5) = ( ) (0.5)𝑛
𝑥
𝑃(|𝑋 − 𝑛/2| > 𝑘) =
∑
𝑓(𝑥/0.5) = (0.5)𝑛
|𝑥−𝑛/2|>𝑘
∑
|𝑥−𝑛/2|>𝑘
𝑛
( )( )
𝑥
If 𝑛 and 𝑘 are given, this can be computed in any of the following ways.
(1) Using the combination formula
(2) Using tables of probabilities of the binomial distribution
(3) Using the BINOMIST function in Excel or using any of the available statistical packages.
Suppose 𝑛 = 10, 𝑘 = 2
10
10
10
10
10
10
𝑃(|𝑋 − 5| > 2) = 𝑃(𝑋 = 0,1,2,8,9,10) = (0.5)10 [( ) + ( ) + ( ) + ( ) + ( ) + ( )]
0
1
2
8
9
10
=
1 + 10 + 45 + 45 + 10 + 1
112
7
=
=
= 0.1094
1024
1024 64
Suppose 𝑛 = 100, 𝑘 = 10
𝑃(|𝑋 − 50| > 10) = 𝑃(|𝑋 − 50| ≥ 11)
𝐸(𝑋) = 100 × 0.5 = 50
𝑉(𝑋) = 100 × 0.5 × 0.5 = 25
Using the continuity adjustment,
𝑃(|𝑋 − 50| ≥ 10.5) = 𝑃(|
𝑋 − 50
10.5
) = 𝑃(|𝑍| ≥ 2.1) = 2𝑃(𝑍 > 2.1) = 2(1 − 𝑃(𝑍 ≤ 2.1))
|≥
5
5
= 2(1 − 0.9821) = 0.0357
Download