T10 Sol..ol
T10 Sol..ol
Tutorial 10 Solution
Here,
✓ ◆ ✓ ◆
1 n 1 2 nx
µ
2
+ 2 ✓ + 2
+ 2 ✓
2 ⌧ ⌧
✓ ◆⇢ ✓ ◆ ✓ ◆
1 n 1 2 nx µ . n 1
= 2
+ ✓ 2 + 2 + 2 ✓
2 ⌧2 2 ⌧ 2 ⌧
✓ ◆⇢ ✓ 2 2
◆
1 n 1 nx⌧ + µ
= 2
+ 2
✓2 2 ✓
2 ⌧ n⌧ 2 + 2
✓ ◆( ✓ 2 2
◆ ✓ 2
◆
2 2
✓ 2
◆)
2 2
1 n 1 nx⌧ + µ nx⌧ + µ nx⌧ + µ
= 2
+ ✓2 2 ✓+
2 ⌧2 n⌧ 2 + 2 n⌧ 2 + 2 n⌧ 2 + 2
✓ (
◆ ✓ ◆2 ✓ ◆2 )
1 n 1 nx⌧ 2 + µ 2 nx⌧ 2 + µ 2
= 2
+ ✓ .
2 ⌧2 n⌧ 2 + 2 n⌧ 2 + 2
https://www.coursehero.com/file/121959962/T10-solpdf/
THE HONG KONG POLYTECHNIC UNIVERSITY
DEPARTMENT OF APPLIED MATHEMATICS
AMA3640 STATISTICAL INFERENCE
Tutorial 11
6. Let X1 , . . . , Xn be a random sample from the Poisson distribution with mean ✓. Set
.
1
THE HONG KONG POLYTECHNIC UNIVERSITY
DEPARTMENT OF APPLIED MATHEMATICS
AMA3640 STATISTICAL INFERENCE
Tutorial 11 Solution
1. Note that ✓b1 ⇠ N(✓, 1/2), ✓b2 ⇠ N(✓, 5/8), and ✓b3 ⇠ N(2✓/3, 4/9).
(b) Since R(✓, ✓b1 ) and R(✓, ✓b2 ) are constant, the Bayes risks of ✓b1 and ✓b2 are 1/2
and 5/8, respectively. The Bayes risk of ✓b3 is
Z 1✓ ◆
4 1 2 4 1 1 1 4 1 13
+ ✓ d✓ = ✓ + ✓3 = + = .
0 9 9 9 0 27 0 9 27 27
(c) Again, the Bayes risks for ✓b1 and ✓b2 are 1/2 and 5/8, respectively. The Bayes
risk of ✓b3 is
Z 1✓ ◆
4 1 2 4 1 1 1 4 1 1
+ ✓ 2✓ d✓ = ✓2 + ✓4 = + = .
0 9 9 9 0 18 0 9 18 2
⇡(✓ | y) / ✓y (1 ✓)n y
=) ✓ | Y = y ⇠ Beta(y + 1, n y + 1).
1
(c) Note that Y ⇠ Binomial(n, ✓). The risk function is given by
(✓ ◆2 ) ✓ ◆ ✓ ◆2
Y +1 Y +1 Y +1
E✓ ✓ = Var + Bias
n+2 n+2 n+2
⇢ 2
Var(Y ) E(Y ) + 1
= + ✓
(n + 2)2 n+2
⇢ 2
n✓(1 ✓) E(Y ) + 1
= + ✓
(n + 2)2 n+2
n✓(1 ✓) {n✓ + 1 ✓(n + 2)}2
= +
(n + 2)2 (n + 2)2
n✓(1 ✓) + (1 2✓)2
=
(n + 2)2
(4 n)✓2 + (n 4)✓ + 1
= .
(n + 2)2
The Bayes risk is
Z 1
(4 n)✓2 + (n 4)✓ + 1 (4 n)(1/3) + (n 4)(1/2) + 1 1
d✓ = = .
0 (n + 2)2 (n + 2)2 6(n + 2)
3. (a) We have
Z 1 Z 1 Z a
E|X a| = |x a|f (x) dx = (x a)f (x) dx + (a x)f (x) dx
1 a 1
Z 1 Z 1 Z a Z a
= xf (x) dx a f (x) dx + a f (x) dx xf (x) dx.
a a 1 1
2
4. The posterior density of ✓ is
n
!✓
Y Pn
⇡(✓ | x) / ✓n xi ✓k 1 e ✓
= ✓n+k 1 e ( i=1 log xi )✓
,
i=1
Pn
Therefore, ✓ | X ⇠ Gamma(n + k, i=1 log Xi ). We have
n
! ✓ ◆
X 1 2
2 log Xi ✓ X ⇠ Gamma n + k, ⌘ 2(n+k) .
i=1
2
It follows that
n
! !
X
2 2
P 2(n+k),1 ↵/2 <2 log Xi ✓< 2(n+k),↵/2 =1 ↵.
i=1
Because the normal density is symmetric, the 95% HPD credible interval is
r !
⌧2 2
/n 2⌧ 2
2 /n + ⌧ 2
X+ 2 µ ± z0.025 .
/n + ⌧ 2 2 + n⌧ 2
The coverage is
s s !
1 1 2 2
P X+ µ z0.025 <✓< X+ µ + z0.025
1+ 1+ n(1 + ) 1+ 1+ n(1 + )
✓ p p ◆
z0.025 1 + z0.025 1 +
=P (1 + )✓ µ p < X < (1 + )✓ µ+ p
n n
✓ ◆
p (✓ µ) X ✓ p (✓ µ)
=P z0.025 1 + + p < p < z0.025 1 + + p ,
/ n / n / n
| {z }
Z ⇠ N(0, 1)
3
6. The posterior density of ✓ is
Pn Pn
n✓ xi 1/2 n✓ xi 1/2
⇡(✓ | x) / e ✓ i=1 ✓ =e ✓ i=1
n
!
X 1
=) ✓ | X ⇠ Gamma Xi + , n
i=1
2
n
!
X 1 1 2P
=) 2n✓ | X ⇠ Gamma Xi + , ⌘ 2 ni=1 Xi +1
.
i=1
2 2
4
The second term in the blanket does not depend on ✓, so
✓ ◆ ( ✓ ◆✓ ◆2 )
nx2 1 n 1 nx⌧ 2 + µ 2
m(x) / exp exp + 2
2 2 2 2 ⌧ n⌧ 2 + 2
Z 1 ( ✓ ◆✓ ◆2 )
1 n 1 nx⌧ 2 + µ 2
⇥ exp 2
+ 2 ✓ d✓
1 2 ⌧ n⌧ 2 + 2
| {z }
proportional to a normal density
✓ ◆ ( ✓ ◆✓ ◆2 )
nx2 1 n 1 nx⌧ 2 + µ 2
/ exp exp + 2
2 2 2 2 ⌧ n⌧ 2 + 2
⇢
1 n
/ exp (x2 2µx)
2 n⌧ + 2
2
⇢
1 n
/ exp (x2 µ)2 ,
2 n⌧ 2 + 2
which is N(µ, ⌧ 2 + 2
/n).
(c) The posterior density of ✓ is
⇡(✓ | x) / f (x | ✓)⇡(✓)
⇢
n 1
/ exp 2
(x ✓)2 (✓ µ)2
2 2⌧ 2
( ✓ ◆✓ ◆2 )
1 n 1 nx⌧ 2 + µ 2
/ exp 2
+ 2 ✓ ,
2 ⌧ n⌧ 2 + 2
/ ✓↵+y 1 e (n+ )✓
,
which implies that
✓ | Y ⇠ Gamma(↵ + Y, n + ).
(b) Generally, for W ⇠ Gamma(↵, ), we have
Z 1 Z
↵
↵ 1 w
↵
(↵ + 1) 1 ↵+1
↵
E(W ) = w w e dw = ↵+1
w↵ e w
dw = .
0 (↵) (↵) 0 (↵ + 1)
Similarly,
Z 1 ↵ ↵
2 (↵ + 2) ↵(↵ + 1)
E(W ) = w2 w↵ 1 e w
dw = ↵+2
= 2
.
0 (↵) (↵)
https://www.coursehero.com/file/121959962/T10-solpdf/
Hence,
↵
Var(W ) = E(W 2 ) {E(W )}2 = 2
.
https://www.coursehero.com/file/121959962/T10-solpdf/
Powered by TCPDF (www.tcpdf.org)