Professional Documents
Culture Documents
TOH Notes
TOH Notes
Kirinyaga University
Introduction
Suppose a random variable X has a pdf f (x1 , θ1 , θ2 , ..., θk ) depending on the unknown parameters θ1 , θ1 , ..., θk
The set of all parameters is denoted by Ω known as the parameter space.
Let Ω0 be a subset of Ω consider the hypothesis:
The above case is a composite hypothesis against a composite one. In this case we do not use Neyman
Pearson lemma but we use a more generalized form of it generalized likelihood ratio test(LRT)
We denote the likelihood function of a sample x1 , x2 , ..., xn by
n
Y
L(Ω) = f (xi , θ1 , θ2 , ..., θk )
i=1
Let L(Ω̂) = max L(Ω) be maximized L(Ω) and L(Ω0 ) = max(L(Ω0 )) be maximized L(Ω0 ) with Ω0 only
We take the likelihood ratio as a quotient
L(Ωˆ0 )
λ=
L(Ω̂)
Since λ is the quotient of non-negative functions it is greater than or equal to zero. Further since Ω0 ∈ Ω
then
L(Ω̂) ≤ L(Ω̂)
hence 0 ≤ λ ≤ 1
To test H0 : θ ∈ Ω0 against Ha : θ ∈ Ω − Ω0 the critical region for the likelihood ratio test is the set of points
in the sample for which
L(Ωˆ0 )
λ= ≤k
L(Ω̂)
1
Example 1 INTRODUCTION
Example 1
X ∼ N (µ, σ 2 ) where µ&σ 2 are unknown. Test the hypothesis
H0 : µ = µ0 vs H1 : µ ̸= µ0
Solution
Let x1 , x2 , ..., xn be a random sample of size n from X then
1 n2 n
− 2σ12
X
L(X, µ, σ 2 ) = e (xi − µ)2
2πσ 2 i=1
In
Ω = {(µ, σ) : −∞ < µ < ∞, σ > 0}
Ω0 = {(µ, σ) : µ = µ0 , σ > 0}
n
n n 1 X
ln L(µ, σ 2 ) = − ln 2π − ln σ 2 − 2 (xi − µ)2
2 2 2σ i=1
n
∂l X (xi − µ)
=0→2 0 → µ̂ = x̄
∂µ i=1
2σ 2
P2
∂ ln L n 1 i=1 (xi − µ)2
2
= 0 → −( ) 2 +
∂σ 2 σ 2(σ 2 )2
1 1
Pn 2
L(Ω̂) = e− 2σ2 i=1 (xi −x̄)
ˆ
2π σ 2
Pn
− (xi −x̄)2
1 n2 h n i n −
1
Pi=1
n
= Pn
2
e n i=1 i
(x −x̄)2 (1)
2
2π i=1 (xi − x̄)
1 n2 h n i n2 n
= P e− 2
2π (xi − x̄)2
1 1
Pn 2
L(Ω̂) = e− 2σ2 i=1 (xi −µ0 )
2π σˆ2 Pn
− (xi −µ0 )2
1 n2 h n i n −
1
Pi=1
n
= Pn
2 (x −µ )2
e n i=1 i 0 (2)
2
2π i=1 (xi − µ0 )
1 n2 h n i n2 n
= P e− 2
2π (xi − µ0 )2
L(Ωˆ0 )
λ= ≤k
L(Ω̂)
h i n2
Pn n
(xi −µ0 )2
= h i=1
i n2 ≤ k (3)
Pn n
(xi −x̄)2
i=1
h Pn (x − x̄)2 i n2
i
= Pni=1 ≤k
i=1 (x i − µ0 )2
P [λ ≤ c] = α
n
X n
X
(xi − µ0 )2 = (xi − x̄ + x̄ − µ0 )2
i=1 i=1
X X (4)
= (xi − x̄)2 + 2(x̄ − µ0 ) (xi − x̄) + n(x̄ − µ0 )2
X
= (Xi − X̄)2 + n(x̄ − µ0 )2
So " # n2
(xi − x̄)2
P
λ= P
(xi − x̄)2 + n(x̄ − µ0 )2
" # n2
1
λ= P
(x̄−µ0 )2
1 + P(x −x̄)2
i
√ √
n(x̄ − µ0 )/σ n(x̄ − µ0 )
T = hP 1 = r
(x −x̄)2
i 2
P
i 2 (xi −x̄)
σ 2 (n−1) n−1
This variable has the student t distribution with n − 1 degrees of freedom when H0 is true.
Thus
n(x̄ − µ0 )2
T2 = P 2
(xi −x̄)
n−1
" # n2
1
λ= T2
1 + n−1
λ ≤ c → T2 ≥ k
P [λ ≤ c|H0 ] = α = P [T 2 ≥ k|H0 ]
√
P [T 2 ≥ k|H0 ] = α = P [|T | > k|H0 ] = α
or
√ α √
P [T > k] = = P [T < − k]
2
So the test is to compute the statistic
√
n(x̄ − µ0 )
T = rP
2
(xi −x̄)
n−1
Example 2
Alfafa yields of six test plots are given by
H0 : µ = 1.8 vs µ ̸= 18
Assume the yields have a normal distribution of mean µ
Solution
The test is to compute
√
n(x̄ − µ0 )2
T = q
(xi −x̄)2
n−1
or
P [−c < T < c|H0 ] = 1 − α = 0.05
Here
n=6
and
x̄ = 1.6
and X
(xi − x̄)2 = 0.88
Therefore
√ √
n(x̄ − µ0 ) 6(1.6 − 1.8)
T = rP = q = −1.17
(xi −x̄)2 0.88
5
n−1
Example 3
X ∼ N (µ, σ 2 )
To test
H0 : µ = µ0 , σ = σ0 is known
vs
H1 : µ = µ1
Solution
Ω0 = {(µ, σ) : µ = µ0 , σ = σ0 }
1 n2 − 1 P(xi −µ)2
2
L(X, µ, σ) = 2 e 2σ0
2πσ0
1 n2 − 1 P(xi −x̄)2
2
L(Ω̂) = e 2σ0
2πσ02
1 n2 − 1 P(xi −µ0 )2
2
L(Ω̂) = e 2σ0
2πσ02
Hence
P
− 1
(xi −µ0 )2
L(Ωˆ0 ) 2σ 2
P P
e 0 − 1
(xi −µ0 )2 + 1
(xi −x̄)2
2σ 2 2σ 2
λ= = 1
P =e 0 0
L(Ω̂) − (xi −x̄)2
2σ 2
e 0
P P
− 1
(xi −µ0 )2 + 1
(xi −x̄)2
2σ 2 2σ 2
λ=e 0 0 ≤k
1 X 2 1 X
− (x i − x̄) + (xi − µ0 )2 ≤ ln k
2σ02 2σ02
1 1 X
2 n(x̄ − µ0 )2 ≤ ln k + 2 (xi − x̄)2
2σ0 2σ0
Then
n(x̄ − µ0 )2
<k
σ02
x̄−µ0
Let Z = σ
√0
∼ N (0, 1)
n
Hence
λ < c ⇒ Z2 > k
or
√
P [λ < c|H0 ] = α ⇒ P [|Z| ≥ k] = α
√ √ √
P [|Z| ≥ k] = α ⇒ P [− k ≤ Z ≤ k] = 1 − α
1 n2 P
− 2σ12 (xi −µ)2
L(X, µ, σ) = e
2πσ 2
The maximum likelihood estimates under Ω are
n
1X
µ̂ = x̄, σˆ2 = (xi − x̄)2
n i=1
Hence
1 n2 h n i n2 n
L(Ω̂) = Pn 2
e− 2
2π i=1 (x i − x̄)
Hence
1 n2 1 − 1 P(xi −x̄)2
L(Ωˆ0 ) =
2
e 2σ0
2π 2σ02
U n2 1
λ= e− 2 (U −n)
n
P
(xi −x̄)2
where U = σ02
α
P [0 < χ2n−1 < a] = = P [χ2(n−1) > b]
2
Consider the sample variance
n
1 X
S2 = (xi − x̄)2
n − 1 i=1
Example
In a random sample of the weights of 19 babies of certain age. The standard deviation was found to be
2.5kgs. Test the hypothesis that
H0 : σ = 3 vs H1 : σ ̸= 3
at α = 0.05
Solution
The statistic is
(n − 1)S 2 18 × 2.52
U= 2 = = 12.5
σ0 32
χ20.025,18 = 31.53 = b
and
χ20.975,18 = 8.23 = a
U = 12.5 lies in the acceptance region therefore we do not reject H0 at 5% level of significance.