px
Homework III
1. Denote the probabilities of getting a 1, 2,· · · , 6 for a die
p1, p2,· · · , p6, respectively and p1+ p2+· · · + p6 = 1. Suppose X1, X2,· · · , X6∼ multinomial(n = 10; p1, p2,· · · , p6).
(a) How to use Monte Carlo method to estimate p1and Pr(X1> X2) via classic statistics approach?
(b) Suppose that we randomly throw the die for 40 times and obtained the following outcomes
1, 5, 6, 5, 4, 2, 3, 4, 3, 2 2, 3, 3, 5, 6, 1, 2, 5, 2, 3 1, 3, 3, 2, 6, 1, 3, 4, 3, 2 3, 2, 3, 4, 2, 4, 3, 3, 2, 5
How to use Monte Carlo method to estimate p1and Pr(X1> X2) via Bayesian statistics approach?
1 of 4 px
Homework III
2. Computing with a non-conjugate single-parameter model: suppose y1,· · · , y5 are independent samples from a Cauchy distribution
p(yi|θ) ∝ 1/(1 + (yi − θ)2)
with unknown center θ and known scale 1. Assume, for simplicity, that the prior distribution for θ is uniform on [0, 1]. Given the observations (y1,· · · , y5) = (2, 1, 0, 1.5, 2.5):
(a) Compute the unnormalized posterior density function, p(θ)p(y|θ), on a grid of points for some large integer m. Using the grid
approximation, compute and plot the normalized posterior density function, p(θ|y),as a function of θ.
(b) Sample 1000 draws of θ from the posterior density and plot a histogram of the draws.
(c) Use the 1000 samples of θ to obtain 1000 samples from the predictive distribution of a future observation, y6, and plot a histogram of the predictive draws.
2 of 4 px
Homework III (from BCWR)
3. Suppose that y1,· · · , yn are a random sample from the Poisson/gamma density
f (y|α, β) = Γ(y + α) Γ(α)y !
βα (β + 1)y +α,
where α > 0 and β > 0. This density is an appropriate model for observed counts that show more dispersion than predicted under a Poisson model. Suppose that (α, β) are assigned the
non-informative prior proportional to 1/(αβ)2. Let the real-valued parameters θ1 = logα and θ2 = logβ.
3 of 4 px
Homework III
3. (Conti.) Use this framework to model data collected by Gilchrist (1984), in which a series of 33 insect traps were set across sand dunes and the numbers of different insects caught over a fixed time were recorded. The number of insects of the taxa
S taphylinoidea caught in the traps are shown here.
2, 5, 0, 2, 3, 1, 3, 4, 3, 0, 3, 2, 1, 1, 0, 6, 0, 0, 3, 0, 1, 1, 5, 0, 1, 2, 0, 0, 2, 1, 1, 1, 0,
(a) By computing the posterior density on a grid, simulate 1000 draws from the joint posterior density of (θ1, θ2).
(b) From the simulated sample, find 90% interval estimates for the parameters α and β.
4 of 4 px