0% found this document useful (0 votes)
67 views2 pages

ST903 Week9sol

1. The document provides solutions to exercises on Bayesian statistics. It finds the parameters for a Beta posterior distribution based on a Bernoulli likelihood and prior. 2. It derives the normal posterior distribution for the mean of a normal distribution, given normal likelihoods and priors. The posterior and predictive distributions for a new data point are also normally distributed with means and variances defined in the solution. 3. Intervals for the posterior and predictive distributions are provided based on the normal forms, showing the intervals shrink as sample size increases from 10 to 100.

Uploaded by

Luke Johnston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views2 pages

ST903 Week9sol

1. The document provides solutions to exercises on Bayesian statistics. It finds the parameters for a Beta posterior distribution based on a Bernoulli likelihood and prior. 2. It derives the normal posterior distribution for the mean of a normal distribution, given normal likelihoods and priors. The posterior and predictive distributions for a new data point are also normally distributed with means and variances defined in the solution. 3. Intervals for the posterior and predictive distributions are provided based on the normal forms, showing the intervals shrink as sample size increases from 10 to 100.

Uploaded by

Luke Johnston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Solutions to Week 9 Exercises

1.a. One possibility to satisfy the conditions is to set

E(θ)(1 − E(θ))
α+β = − 1 = 1.67
Var(θ)

α = (α + β)E(θ) = 1, and

β = (α + β)(1 − E(θ)) = 0.67.

1.b. Let X1 , . . . , X1000 ∼ Bernoulli(θ). Here, n = 1000 and Xj = 1 if the person supports the death
P
penalty, and Xj = 0 if otherwise. Thus, Xj = 650. From the lecture, the posterior distribution for θ|X is

Beta(α + 650, β + 350) = Beta(651, 350.67). Thus, the posterior mean is 0.6499 and the posterior variance is

0.015.

2. Throughout, we will use the following identity for completing the square: ax2 − 2bx = a(x − b/a)2 − b2 /a.

2.a. Let Y1 , . . . , Yn ∼ N (θ, σ 2 ), and suppose we have the normal prior θ ∼ N (µ, τ 2 ). Here, σ = 20, µ = 180,

and τ = 40. Then the posterior distribution is

π(θ|Y) ∝ f (Y|θ)π(θ)
   
1 X 1
∝ exp − 2 (Yj − θ)2 exp − 2 (θ − µ)2
2σ 2τ
 
1 X 1
∝ exp − 2 (−2Yj θ + θ2 ) − 2 (θ2 − 2µθ)
2σ 2τ
 
1 1
∝ exp − 2 (−2nȲn θ + nθ2 ) − 2 (θ2 − 2µθ)
2σ 2τ
 
1
∝ exp − 2 2 (σ 2 + nτ 2 )θ2 − 2(nτ 2 Ȳn + σ 2 µ)θ

2σ τ
σ 2 + nτ 2
 2
nτ Ȳn + σ 2 µ
  
∝ exp − θ −
2σ 2 τ 2 σ 2 + nτ 2

Thus, θ|Y is normally distributed with mean

nτ 2 Ȳn + σ 2 µ
σ 2 + nτ 2

1
and variance
σ2 τ 2
σ 2 + nτ 2

2.b. Let ψ and φ2 be the mean and variance of θ|Y, respectively. Then

Z Z    
1 2 1 2
f (ỹ|θ)π(θ|Y)dθ ∝ exp − 2 (ỹ − θ) exp − 2 (θ − ψ) dθ
2σ 2φ
 Z  
1 2 1 2 2 2 2 2

∝ exp − 2 ỹ exp − 2 2 (φ + σ )θ − 2(φ ỹ + σ ψ)θ dθ
2σ 2σ φ
(φ2 ỹ + σ 2 ψ)2
    
1 2 1
∝ exp − 2 ỹ exp − 2 2 −
2σ 2σ φ φ2 + σ 2
4
φ2 σ 2 ψ
   
1 2 φ 2
∝ exp − 2 2 φ − 2 ỹ − 2 ỹ
2σ φ φ + σ2 φ + σ2
 
1
∝ exp − (ỹ − ψ)2
2(σ 2 + φ2 )

nτ 2 Ȳn +σ 2 µ σ2 τ 2
Thus, Ỹ |Y is normally distributed with mean ψ = σ 2 +nτ 2 and variance σ 2 + φ2 = σ 2 + σ 2 +nτ 2 .

2.c. To create the intervals for the posterior distribution and the posterior predictive distribution, we use

the fact that these distributions are normal with their respective mean and variance specified above. For

n = 10, the posterior interval is (138.5,163.0) and the predictive interval is (109.7,191.8). For n = 100, these

intervals get tighter to (146.16,153.99) and (110.68,189.57), respectively.

You might also like