The number of defects in an iron casting can be assumed to follow a Poisson distribution with
Question:
The number of defects in an iron casting can be assumed to follow a Poisson distribution with mean θ. A quality engineer inspected nine castings and observed the following number of defects in them: 0, 2, 2, 3, 3, 1, 2, 1, 1. Assume that θ has a prior distribution Gamma(2, b), where the hyperparameter b is assumed to have a distribution Exp(1).
Use Gibbs sampling to sample from the posterior distribution of θ (generate 100,000 samples and use 1,000 samples as burn-in) and answer the following: 1. Plot the posterior density of θ. 2. Find the posterior mean of θ. 3. Find 95% equitable credible interval of θ.
Note: the density of a Gamma(a, b) is given by ba/Γ(a)xa−1 e −bx and the density of Exp(λ) is given by λe−λx.
Probability & Statistics for Engineers & Scientists
ISBN: 978-0130415295
7th Edition
Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying