Suppose that the number of new cases of a medical condition observed each week can be modelled using a negative binomial distribution with parameters q and r, q is unknown, while r is known. We observe n weeks’ worth of data, and the number of cases each week was y1, . . . , yn. (a) Show that a beta distribution provides a conjugate prior distribution for q, and find the posterior distribution with such a prior. The column in the exercise 2 dataset labelled y, contains the observed data y1, . . . , yn. Assume that r is equal to 3. (b) With a uniform prior distribution for q on the interval [0, 1], what is the posterior distribution for q (including the numerical value of the parameters)? (c) What is the posterior mean? (d) Use R to find the posterior median and a 95% credible interval for q.
Suppose that the number of new cases of a medical condition observed each week can be modelled using a negative binomial distribution with parameters q and r, q is unknown, while r is known.
We observe n weeks’ worth of data, and the number of cases each week was y1, . . . , yn.
(a) Show that a beta distribution provides a conjugate prior distribution for q, and find the posterior distribution with such a prior.
The column in the exercise 2 dataset labelled y, contains the observed data y1, . . . , yn.
Assume that r is equal to 3.
(b) With a uniform prior distribution for q on the interval [0, 1], what is the posterior distribution for q (including the numerical value of the parameters)?
(c) What is the posterior mean?
(d) Use R to find the posterior
Step by step
Solved in 3 steps with 14 images