The University of of Mathematics and Statistics
Solutions to Tutorial Week 7
STAT3023: Statistical Inference Semester 2, 2021
Lecturers: and
Copyright By PowCoder代写 加微信 powcoder
1. Suppose X has a gamma distribution with known shape γ0 > 0 and unknown scale parameter θ (see the computer exercise). Then X has PDF
f(x; γ0, θ) = xγ0−1e−x/θ θγ0 Γ(γ0)
for x > 0, and 0 otherwise. Since this is an exponential family with sufficient statistic X (and X has a continuous distribution, so no randomisation required), the UMPU test of H0 : θ = θ0 againstH1:θ̸=θ0 isoftheform
1 forX
δ(X) = (1)
0 otherwise
where the constants c and d are chosen so that both the following equalities hold:
Eθ0 [δ(X)]=α; (2) Eθ0 [Xδ(X)]=αEθ0(X). (3)
(a) Write down a formula for Eθ (X ).
Solution: This may be derived using integration by parts:
xf(x;γ0,θ)dx xγ0−1e−x/θ
x θγ0Γ(γ) dx
Γ(γ0 + 1)θ ∞ x(γ0+1)−1e−x/θ
= γ0Γ(γ0)θ
Γ(γ0) 0 θγ0+1Γ(γ0 + 1) dx Γ(γ0 )
due to the well-known “factorial property” Γ(γ0 + 1) = γ0Γ(γ0) of the gamma function and
that the last integral above is of another gamma PDF, and so is 1. (b) Show that the conditions (2) and (3) above imply
f(x;γ0,θ0)dx= f(x;γ0 +1,θ0)dx.
The left-hand side of (3) is given by
c xγ0−1e−x/θ0 ∞ xγ0−1e−x/θ0
x θγ0Γ(γ ) dx+ x θγ0Γ(γ ) dx 000d00
= θγ0 Γ(γ ) xγ0 e−x/θ0 dx + xγ0 e−x/θ0 dx 000 d
= θ0γ0 =Eθ0(X)
dx + δ(x)f(x;γ0 +1,θ0)dx.
γ0+1 dx θ0 Γ(γ0 + 1)
c x(γ0+1)−1e−x/θ0 γ0+1
∞ x(γ0+1)−1e−x/θ0
Copyright © 2021 The University of Sydney
0 θ0 Γ(γ0 + 1) ∞
Thus by (3) this last integral must equal α and so by (2) it must also be equal to ∞
Finally note that
f(x;γ0 +1,θ0)dx = c
xγ0e−x/θ0 dx Γ(γ0+1) c
1 dd
Eθ0 [δ(X)]=
d ∞ f(x; γ0, θ0) dx = 1 −
δ(x)f(x; γ0, θ0) dx
δ(x)f(x;γ0 +1,θ0)dx f(x;γ0 +1,θ0)dx.
as required.
(c) By integrating the right-hand side of (4) by parts, show that c and d in (1) satisfy
cγ0 e−c/θ0 = dγ0 e−d/θ0 . (5) Solution: The right-hand side of (4) may be written as
δ(x)f(x;γ0,θ0)dx.
xγ0 −θ0e−x/θ0
1 d1d
Γ(γ0 + 1) Γ(γ0+1)
+ γ0xγ0−1θ0e−x/θ0 dx c
xγ0 γ0
−θ0 e−x/θ0
+ γ0 xγ0 −1 e−x/θ0 dx θ0 Γ(γ0) c
+ f(x;γ0,θ0)dx
θ0 Γ(γ0+1)
θ0 Γ(γ0+1)
γ0 −x/θ0d x e .
f(x;γ0,θ0)dx− γ0
Therefore by condition (4) this last term must be zero, so that
cγ0 e−c/θ0 = dγ0 e−d/θ0 .
(d) Explain why the UMPU test of H0 : θ = θ0 against H1 : θ ̸= θ0 rejects for large values of
X X μ −log μ
where μ0 = γ0θ0 = Eθ0 (X), the expected value of X under H0. Solution: The condition (5) is equivalent to
ce−c/(θ0γ0) = de−d/(θ0γ0)
which may be rewritten as
Thus the interval (c, d) may be viewed as the “level set” obtained by drawing a horizontal
line that cuts the graph of the function given by
g(x) = μx e−x/μ0 .
e μ0 = e μ0 . μ0
UMPU Gamma test
(x/mu) * exp(−x/mu)
Thus we reject for all X such that the random variable μX e−X/μ0
is less than some threshold (chosen so the test has level α). Equivalently, we reject for large values of
X X μ−logμ .
2. Suppose X1,…,Xn (for n ≥ 2) are iid N(μ,σ2) and we are interesting in testing
H0:σ2 =σ02 against H1:σ2 ̸=σ02 (6)
(a) The statistic Y = 1 n (Xi − X ̄)2 ∼ σ2 χ2n−1 which is the same as a gamma random 2 i=1 2
variable with (known) shape n−1 and (unknown) scale parameter σ2. It turns out that the 2
UMPU test of (6) is the same as the test from question 1 applied to the statistic Y (which makes sense since Y is sufficient for the scale parameter σ2). Show that this test rejects for large values of
where S2 = 2Y = n−1
σ02−log σ02 (7)
1 n (Xi − X ̄)2 is the sample variance. n−1 i=1
Applying the test from question 1, we reject for large values of
Y Y μ−logμ ,
whereμ=E (Y)=σ02(n−1)istheexpectedvalueofYunderH.Butnotethat 0H02 0
Y= 2Y =S2 μ0 σ02(n − 1) σ02
as required.
(b) In the Advanced Homework it is shown that the UMPU (two-sided) test of a gamma scale parameter (for known shape parameter) is equivalent to the GLRT of the same hypotheses. Is this true in this case; is the GLRT of the hypotheses (6) above equivalent to the test rejecting for small values of (7)?
Solution: The log-likelihood is l(μ,σ2;X)=−nlogσ−nlog 2π−2σ2
The “unrestricted” maximum likelihood estimators are μˆ = X ̄ and σˆ2 = n1 ni=1(Xi −X ̄)2. Under the restriction of H0 : σ2 = σ02, the maximum likelihood estimator of μ remains X ̄. Thus the GLRT rejects for large values of the statistic
−nlogσˆ− 1 Xi −X ̄2 −{−nlogσ0}+ 1 Xi −X ̄2
=−nlog σˆ −n+nσˆ2 σ0 2 2σ02
n σˆ2 n nσˆ2 = − 2 log σ − 2 + 2σ2
00 n σˆ 2 σˆ 2
=2 σ02−log σ02 −1 which is an increasing function of
This is almost the same as the UMPU statistic, but the unbiased variance estimator S2 =
2Y has been replaced with the biased mle σˆ2 = 2Y . n−1 n
To see that these are different tests, note that if we express the two statistics in terms of Y = 21 ni=1(Xi − X ̄)2, the UMPU statistic is an increasing function of
2Y −logY (n − 1)σ02
σˆ 2 σ02−logσ02 .
while the GLRT is an increasing function of
3. Suppose X1, . . . , X5 are iid Poisson(θ) random variables. Determine the UMP test of H0 : θ = 1
against H1 : θ < 1 at level 0.05. Hint: you will need to calculate a few Poisson probabilities! Solution: The likelihood is
This is a 1-parameter exponential family with sufficient statistic T = 5i=1 Xi (indeed it is monotone likelihood ratio in this sum) so the UMP test rejects for small values of the sum, indeed it is of the form
δ(X)=1{T
for 0 ≤ x ≤ θ, otherwise.
n xk+n θ xk+n−1 dx = =
Setting k = 1 gives
EθX(n)= nθ . n+1
Thus choosing cn = n+1 gives us that n
so cnX(n) is unbiased.
(ii) have the smallest possible MSE, i.e. for which Eθ cnθML − θ
is minimised?
Solution: Setting k = 2 in (8) above gives
Eθ X(n) =n+2. So for any choice of cn, the MSE is
Eθ cnX(n) = θ ,
nθ2nθ2 c2E X2 −2c θE X +θ2 =c2 −2c
nθ (n) n θ (n) Differentiating with respect to cn gives
nn+2 nn+1 2nθ2 cn − 1
and setting this equal to zero gives
cn = n + 2 .
The resulting estimator
n+2 n+1 X(n)
is biased, but still has a smaller MSE than both X(n) itself and the unbiased estimator n+1
found in the previous part, and in
(d) Determine the form of the GLRT for testing H0 : θ = θ0 against H1 : θ ̸= θ0.
Solution: For any θ1 ̸= θ0 the likelihood ratio is (assuming X(1) > 0)
1X(n) ≤θ1 θ0n +∞ ifθ0
if X(n) > θ0, if X(n) ≤ θ0.
= X(n)n θ0
For any positive constant c,
11 L(X )
δ(X)= 0 forθ0αn1 ≤X(n)≤θ0 1 forX(n)<θ0αn1.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com