Lecture 10
Lecture 10
and let L(ω̂) and L(Ω̂) be the maximum values attained by L(ω) and L(Ω) respectively.
If λ is defined by
L(ω̂)
λ = λ(x1 , x2 , . . . , xn ) =
L(Ω̂)
the likelihood ratio tests rejects H0 iff λ ≤ λ0 where λ0 is such that
P (λ(X1 , X2 , . . . , Xn ) ≤ λ0 : H0 ) = α.
1
HYPOTHESIS TESTING Likelihood Ratio Tests
Example One
P 2
∂ ln L(ω) ∂ n xi
= − ln 2πθ2 −
∂θ2 ∂θ2 2 2θ2
P 2
n xi
=− +
2θ2 2θ22
and
x2i
P
∂ ln L(ω)
=0 if θ2 =
∂θ2 n
giving
n2 P 2
1 x
L(ω̂) = P exp − P i2
x2i x
2π n 2 ni
−1
n2
ne
=
2π x2i
P
2
HYPOTHESIS TESTING Likelihood Ratio Tests
∂ ln L(Ω) ∂ n 1 X 2
= − ln 2πθ2 − (xi − θ1 )
∂θ2 ∂θ2 2 2θ2
(xi − θ1 )2
P
n
=− +
2θ2 2θ22
P
∂ ln L(Ω) (xi − θ1 )
=
∂θ1 θ2
and solving
∂ ln L(Ω) ∂ ln L(Ω)
= 0 and =0
∂θ2 ∂θ1
gives
(xi − x̄)2
P P
xi
θ1 = = x̄ and θ2 = .
n n
Thus n2
(xi − x̄)2
P
1
L(Ω̂) = P exp − P
(xi −x̄)2 (xi −x̄)2
2π n 2 n
−1
n2
ne
=
2π (xi − x̄)2
P
and n2
(xi − x̄)2
P
λ= P 2
xi
1
= n2
nx̄2
1 + P(x −x̄)2 i
In the null hypothesis θ1 = 0 and x̄ = 0Pconfirms the null hypothesis and x̄ = 0 and
x2i > 0 imply λ = 1. As x̄ and nx̄2 / (xi − x̄)2 deviate from zero and negate H0 ,
P
λ < 1 so region for testing H0 is λ ≤ λ ≤ λ0 .
λ ≤ λ0 iff
1
n2 ≤ λ0 .
nx̄ 2
1 + P(x −x̄)2
i
3
HYPOTHESIS TESTING Likelihood Ratio Tests
That is
nx̄2 −2/n
1+ P 2
≥ λ0
(xi − x̄)
nx̄2 −2/n
P 2
≥ λ0 −1
(xi − x̄)
√
n|x̄|
q
−2/n
rP ≥ (n − 1)(λ0 − 1) = c
(xi −x̄)2
n−1
4
HYPOTHESIS TESTING Likelihood Ratio Tests
Example Two
Consider random samples of size n and m from two normal distributions X1 ∼ N (θ1 , θ3 )
and X2 ∼ N (θ2 , θ3 ) to test
In this case
and
n+m Pn Pm
− θ1 )2 + 1 (yi − θ1 )2
1 1 (xi
2
L(ω) = exp −
2πθ3 2θ3
n+m Pn 2
Pm 2
1 1 (xi − θ1 ) + 1 (yi − θ2 )
2
L(Ω) = exp −
2πθ3 2θ3
Solving
∂ ln L(ω) ∂ ln L(ω)
= 0 and =0
∂θ1 ∂θ3
gives
(xi − θ1 )2 + (yi − θ1 )2
P P P P
x i + yi
θ̂1 = and θ̂3 = =w
n+m n+m
and
n+m
e−1 2
L(ω̂) =
2πw
Solving
∂ ln L(ω) ∂ ln L(ω) ∂ ln L(ω)
= 0, =0 and =0
∂θ1 ∂θ2 ∂θ3
gives
(xi − θ1 )2 + (yi − θ2 )2
P P P P
xi yi
θ̂1 = , θ̂2 = and θ̂3 = = w′ .
n m n+m
5
HYPOTHESIS TESTING Likelihood Ratio Tests
Thus
n+m
e−1 2
L(Ω̂) =
2πw′
so that
w′ n+m
2
λ= .
w
1
= nm 2
n+m (X̄−Ȳ )
1+ P 2
(Xi −X̄) +
P
(Yi −Ȳ )2
n+m−2
=
(n + m − 2) + T 2
for q
nm
n+m (X̄ − Ȳ )
T = rP P
(Xi −X̄)2 + (Yi −Ȳ )2
n+m−2
6
HYPOTHESIS TESTING Likelihood Ratio Tests
Example Three
Consider a random sample of size n from a uniform distribution on the interval [0, θ] to
test
H0 : θ = θ0 against H1 : θ < θ0 .
In this case
ω = {θ : θ = θ0 }
Ω = {θ : 0 < θ ≤ θ0 }
and 1 n
L(θ) = 0 ≤ xi ≤ θ
θ
so that 1 n
L(ω̂) = .
θ0
The maximum of L(θ) under Ω is obtained by using the maximum likelihood estimator
of θ which is X(n) so that
1 n
L(Ω̂) = .
x(n)
L(ω̂) x n
(n)
λ= =
L(Ω̂) θ0
and the test is to reject H0 if x n
(n)
≤ λ0
θ0
x(n) 1/n
≤ λ0
θ0
1/n
x(n) ≤ θ0 λ0
1/n
subject to P (x(n) ≤ θ0 λ0 |H0 ) = α.
In this case
θ λ1/n n
1/n 0 0
P (x(n) ≤ θ0 λ0 |H0 ) =
θ0
= λ0
and so the test is to reject H0 if
x(n)
≤ α1/n .
θ0
7
HYPOTHESIS TESTING Likelihood Ratio Tests
Example Four
Consider a random sample of size n from a distribution with probability density function
To test
H0 : θ = θ 0 against H1 : θ > θ 0
we have
ω = {θ : θ = θ0 }
Ω = {θ : θ ≥ θ0 }
and P
xi
L(θ) = θn e−θ
so that P
xi
L(ω̂) = θ0n e−θ0 .
n n
L(Ω̂) = P e−n .
xi
Then P
L(ω̂)θ0n e−θ0 xi
λ= = n
L(Ω̂) Pn e−nxi
8
HYPOTHESIS TESTING Likelihood Ratio Tests
We reject if
θ P x n P
0 i
e−θ0 xi +n ≤ λ0
n
and letting y = θ0 x̄ this becomes to reject if
y n e−n(y−1) ≤ λ0 .
∂
n ln y − n(y − 1) = 0 if y = 1 the function y n e−n(y−1) ≤ λ0 has a
Noting that ∂y
maximum value of 1 and
y n e−n(y−1) ≤ λ0 iff y ≤ k
where k is chosen so that size of the test is α.
9
HYPOTHESIS TESTING Likelihood Ratio Tests
Example Five
To test
H0 : σ 2 = σ02 against H1 : σ 2 6= σ02
we have
ω = {µ, σ 2 : −∞ < µ < ∞, σ 2 = σ02 }
Ω = {µ, σ 2 : −∞ < µ < ∞, σ 2 ≥ 0}
and 1 n h 1 X x − µ 2 i
i
L(θ) = √ exp −
σ 2π 2 σ
so that 1 n/2 h 1 X x − µ 2 i
i
L(ω̂) = 2 exp − .
2πσ0 2 σ0
Then
L(ω̂)
λ=
L(Ω̂)
P(x − x̄)2 n/2 h 1 X x − x̄ 2 n i
i i
= 2 exp − +
nσ0 2 σ0 2
σ̂ 2 n/2 h n σ̂ 2 n i
= exp − +
σ02 2 σ02 2
10
HYPOTHESIS TESTING Likelihood Ratio Tests
Let
σ̂ 2
y=
σ02
so that n n
λ = y n/2 exp − y +
2 2
and λ ≤ λ0 is equivalent to
ye−y ≤ e−1 (λ0 )2/n .
If we have
σ̂ 2 1 P(X − X̄)2
i
P 2 ≤a =P n ≤ a
σ0 σ02
(X − X̄)2
P
i
=P ≤ na
σ02
(n − 1)S 2
=P ≤ na
σ02
= P χ2n−1 ≤ na
= α/2
and similarly
σ̂ 2
≥ b = P χ2n−1 ≥ nb = α/2
P
σ02
the test becomes to reject H0 if
σ̂ 2 σ̂ 2
≤a or ≥b
σ02 σ02
where
na = χ2n−1;1−α/2 and nb = χ2n−1;α/2 .
11