Professional Documents
Culture Documents
Week 12
Week 12
X1 , . . . , Xn ∼ iid Normal(µ, σ 2 )
1
Sample mean X = (X1 + · · · + Xn ), E [X ] = µ
n
1
Sample variance S 2 = ((X1 −X )2 + · · · + (Xn −X )2 ), E [S 2 ] = σ 2
n−1
N(0, 1/ n)
1.0 n=1
n=5
2 n = 10
X ∼ Normal(µ, σ /n) 0.5
0.0
3 2 1 0 1 2 3
2
n
(n − 1) 2
S ∼ χ2n−1 0.5
σ2 0.0
0 2 4 6 8 10 12 14
tn
X −µ 0.4
√ ∼ tn−1 0.2
S/ n
0.0
3 2 1 0 1 2 3
c − µ0
α = P(T > c|µ = µ0 ) = P(tn−1 > √ )
s/ n
X1 , . . . , Xn ∼ iid Normal(µ, σ 2 )
X1 , . . . , Xn ∼ iid Normal(µ, σ 2 )
(n − 1) 2 (n − 1) 2 (n − 1) 2
α = P(S > c|H0 ) = P( 2 S > 2 c ) = P(χ2n−1 > c )
σ0 σ0 σ02
F(n1, n2)
1.75 n1 = n2 = 1
n1 = n2 = 5
n1 = 5, n2 = 10
1.50
σ2 σ2 1.25
X − Y ∼ Normal(µ1 − µ2 , 1 + 2 )
n1 n2 1.00
0.75
SX2 0.50
∼ F (n1 − 1, n2 − 1) 0.25
SY2
0.00
0.0 0.5 1.0 1.5 2.0 2.5 3.0
Null H0 : µ1 = µ2 , Alternative HA : µ1 6= µ2
T = Y − X , Test: Reject H0 if |T | > c
Null H0 : µ1 = µ2 , Alternative HA : µ1 6= µ2
T = Y − X , Test: Reject H0 if |T | > c
How to compute significance level?
σ12 σ22
Given H0 , T ∼ Normal(0, σT2 ), where σT2 = n1 + n2
c
α = P(|T | > c|H0 ) = P(|Normal(0, 1)| > )
σT
Null H0 : σ1 = σ2 , Alternative HA : σ1 6= σ2
SX2
T = , Test: Reject H0 if T > 1 + cR or T < 1 − cL
SY2
Null H0 : σ1 = σ2 , Alternative HA : σ1 6= σ2
SX2
T = , Test: Reject H0 if T > 1 + cR or T < 1 − cL
SY2
How to compute significance level?
Given H0 , T ∼ F (n1 − 1, n2 − 1)
Instrument 1 Instrument 2
1004 3005
999 2995
993 3019
1000 2993
1008 2992
1002 2991
994 3015
999 2986
X1 , . . . , Xn ∼ P
X1 , . . . , Xn ∼ P
X1 , . . . , Xn ∼ P
X1 , . . . , Xn ∼ Bernoulli(p)
0.6w 0.4n−w
T = >c
0.5n
where w is the number of H’s in the samples
X1 , . . . , Xn ∼ Bernoulli(p)
0.6w 0.4n−w
T = >c
0.5n
where w is the number of H’s in the samples
Likelihood ratio test is equivalent to w > wc
I Eg, n = 100: Reject null if number of H > 55
Theorem
Suppose both null and alternative hypotheses are simple, and there is some
test that achieves a power of 1 − β at a significance level α. Then, there is
a likelihood ratio test at significance level α achieving power at least as high
as 1 − β.
Good news: For simple null and alternative, likelihood ratio tests are
enough.
Theorem
Suppose both null and alternative hypotheses are simple, and there is some
test that achieves a power of 1 − β at a significance level α. Then, there is
a likelihood ratio test at significance level α achieving power at least as high
as 1 − β.
Good news: For simple null and alternative, likelihood ratio tests are
enough.
Bad news
I If any of the hypotheses are composite, then the optimality result does
not hold.
I In most situations, we will not have simple null and alternative!
Grade S A B C D E U
Fit p/32 p/4 p/2 1−p p/8 p/16 p/32
Observed 15 97 203 397 55 33 10
Grade S A B C D E U
Fit p/32 p/4 p/2 1−p p/8 p/16 p/32
Observed 15 97 203 397 55 33 10
Grade S A B C D E U
Expected 12.9 103.2 206.6 396.9 51.6 25.8 12.9
Grade S A B C D E U
Fit p/32 p/4 p/2 1−p p/8 p/16 p/32
Observed 15 97 203 397 55 33 10
Grade S A B C D E U
Expected 12.9 103.2 206.6 396.9 51.6 25.8 12.9
a1 a2 ... ak
Observed y1 y2 ... yk
Expected np1 np2 ... npk
a1 a2 ... ak
Observed y1 y2 ... yk
Expected np1 np2 ... npk
a1 a2 ... ak
Observed y1 y2 ... yk
Expected np1 np2 ... npk
Grade S A B C D E U
Observed 15 97 203 397 55 33 10
Expected 12.9 103.2 206.6 396.9 51.6 25.8 12.9
[0.0, 0.2] [0.2, 0.4] [0.4, 0.6] [0.6, 0.8] [0.8, 1.0]
Observed 7 23 40 28 6
Expected 5.8 25.9 36.5 25.9 5.8
Eg: Expected count for [0.2, 0.4] = 100(FB(3,3) (0.4) − FB(3,3) (0.2)) = 25.9
[0.0, 0.2] [0.2, 0.4] [0.4, 0.6] [0.6, 0.8] [0.8, 1.0]
Observed 7 23 40 28 6
Expected 5.8 25.9 36.5 25.9 5.8
Eg: Expected count for [0.2, 0.4] = 100(FB(3,3) (0.4) − FB(3,3) (0.2)) = 25.9
[0.0, 0.2] [0.2, 0.4] [0.4, 0.6] [0.6, 0.8] [0.8, 1.0]
Observed 7 23 40 28 6
Expected 5.8 25.9 36.5 25.9 5.8
Eg: Expected count for [0.2, 0.4] = 100(FB(3,3) (0.4) − FB(3,3) (0.2)) = 25.9
P-value = 1 − Fχ2 (1.09) = 0.895 is quite high. So, accept fit to Beta(3,3).
4
S A B C D E U Total
Math I 15 97 203 387 55 33 10 800
Stats I 28 182 381 726 103 62 19 1500
CT 47 303 634 1209 172 103 31 2500
Total 90 582 1218 2321 331 198 60 4800
S A B C D E U Total
Math I 15 97 203 387 55 33 10 800
Stats I 28 182 381 726 103 62 19 1500
CT 47 303 634 1209 172 103 31 2500
Total 90 582 1218 2321 331 198 60 4800
S A B C D E U Total
Math I 15 97 203 387 55 33 10 800
Stats I 28 182 381 726 103 62 19 1500
CT 47 303 634 1209 172 103 31 2500
Total 90 582 1218 2321 331 198 60 4800
Expected, if independent
S A B C D E U
Math I 15 97 203 386.8 55.2 33 10
Stats I 28.1 181.9 380.6 725.3 103.4 61.9 18.8
CT 46.9 303.1 634.4 1208.9 172.4 103.1 31.2