# Hierarchical Bayes model | My Assignment Tutor

For the hierarchical Bayes model of Exercise 11.4.2, set n = 50 and a = 2. Now, draw a θ at random from a Γ(1, 2) distribution and label it θ∗. Next, draw a p at random from the distribution with pdf  Finally, draw a y at random from a distribution. (a) Setting m at 3000, obtain an estimate of θ∗ using your Monte Carlo algorithm of Exercise 11.4.2. (b) Setting m at 3000 and  at 6000, obtain an estimate of θ∗ using your Gibbs sampler algorithm of Exercise 11.4.3. Let denote the stream of values drawn. Recall that these values are (asymptotically) simulated values from the posterior pdf  Use this stream of values to obtain a 95% credible interval. Exercise 11.4.3 Reconsider the hierarchical Bayes model (11.4.17) of Exercise 11.4.2. (a) Show that the conditional pdf  is the pdf of a beta distribution with parameters y + θ and n − y + 1. (b) Show that the conditional pdf  is the pdf of a gamma distribution with parameters 2 and  (c) Using parts (a) and (b) and assuming squared-error loss, write the Gibbs sampler algorithm to obtain the Bayes estimator of p. Exercise 11.4.2 Consider the hierarchical Bayes model (a) Assuming squared-error loss, write the Bayes estimate of p as in expression (11.4.3). Integrate relative to θ first. Show that both the numerator and denominator are expectations of a beta distribution with parameters y + 1 and n − y + 1. (b) Recall the discussion around expression (11.3.2). Write an explicit Monte Carlo algorithm to obtain the Bayes estimate in part (a).

QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER