Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT404 : Fall 2022

Midterm (Take-home)

1.  (60 points) Let X1 , ...,Xn|θ  Bernoulli(θ), and assume that you have obtained a sample with x =  xi  = 15 successes in n = 22 trials.  Suppose that the value of θ is unknown and that you assign to θ , p(θ) for 0 < θ < 1.  Consider the following prior distribution with p.d.f.

p(θ) =

(a)  (15 points) Find the prior variance of θ, Var(θ) and the posterior variance of θ, Var(θ|x), analytically or numerically. Compare two variances and make a comment on your find- ings.

(b)  (15 points) Plot three graphs in one figure, showing the prior density, likelihood and posterior density of θ all together. You may consider scaling them for a better graphical display. What if you observe n = 300 and x = 220? Compare two cases one with x = 15 and n = 22, and the other with x = 220 and n = 300. Make a comment on your findings.

(c)  (10 points) Suppose we conduct m = 15 new trials and let  denote the number of successes in these new trials.   Specify and sketch the posterior predictive p.m.f.   of  = , the number of successes you might observe in these m = 15 trials. You can use either a Monte Carlo approximation or numerical calculation.

(d) Let ϕ = θ 2 , and suppose that instead of estimating θ, it is desired to estimate the value of ϕ subject to the following squared error loss function :

L(ϕ,a) = (ϕ − a)2   for ϕ > 0 and a > 0.

1  (10 points) Generate n = 104  random variables ϕ 1 , . . . ,ϕn  from the posterior dis-

tribution of θ .  Plot the (empirical) posterior density of ϕ based on your random numbers, overlapped with the (exact) posterior density of ϕ .  Make a comment on your findings.

2  (10 points) Let  denote the Bayes estimator of ϕ  and let θˆ denote the Bayes

estimator of θ when the squared error loss function L(θ,a)  =  (θ − a)2  is used. Provide your estimates of  and θˆ2 . Which one is larger between  and θˆ2 ? Make a comment on your findings.

2.  (40 points) Bortkiewicz (1898) counted the numbers of Prussian soldiers killed by horsekick (a more serious problem in the nineteenth century than it is today) in 14 army units for each of 20 years, a total of 280 counts. The 280 counts have the following values: 144 counts are 0,

91 counts are 1, 32 counts are 2, 11 counts are 3, and 2 counts are 4. No unit suffered more than four deaths by horsekick during any one year (These data were reported and analyzed by Winsor, 1947).  Suppose that we model the 280 counts as a random sample of Poisson random variables X1 , . . . ,X280  with mean θ conditional on the parameter θ .

Number of deaths

0

1

2

3

4

5 

Number of units

144

91

32

11

2

0

(a) Suppose that the value of θ is unknown and the prior distribution of θ is a gamma distribution for which the mean is 0.1 and the standard deviation is 0.1.

1  (10 points) Construct a 95% Bayesian confidence interval (credible interval) for θ .

You can use grid approximations or Monte Carlo simulations.

2  (10 points) Consider the following loss function, called a LINEX (LINear-Exponential)

loss,

L(θ,a) = e(a θ) (a θ) 1.

Find a Bayes estimate of θ using a LINEX loss function and observed data x1 , . . . ,x280 . You can use grid approximations or Monte Carlo simulations.

(b) Alternatively, you assign a prior distribution on θ , p(θ) ∝ 1/θ2  on θ ∈ (0, 10).

1  (10 points) Plot the posterior density of θ and compute the posterior mean of θ .

You can use grid approximations or Monte Carlo simulations.

2  (10 points) Suppose that |θ ∼ Poisson(θ) and that  is conditionally independent of X1 , . . . ,X280  given θ . Find the predictive probability that  is larger than zero given the observed data x1 , . . . ,x280 , P( > 0|x1 , . . . ,xn).

3.  (Bonus 20 points)

(a)  (10  points)  Consider problem  #1 again.   However,  suppose that you believe  θ  ∈ [0.35, 0.6] according to your prior knowledge and that a beta prior distribution for θ is used with parameters 10 and 10, but truncated to [0.35, 0.6],

p(θ)

Find the posterior mean of θ, E(θ|x1 , . . . ,xn) analytically or numerically.

(b)  (10 points) Consider problem #2 again. However, suppose that the following two prior densities of θ are used,

p1 (θ) =

for θ > 0, otherwise.

p2 (θ) = {0(k) (1 + (8θ)2 )1 ,

for θ > 0,

otherwise.

Find the posterior standard deviation of θ , ^Var(θ|x1 , . . . ,xn), using each of two prior

densities, p1 (θ) and p2 (θ), respectively (analytically or numerically).