Bayesian Statistics
2.5 Exercises on Chapter 2
You can find formulae for named distributions in Appendix A.
-
2.1
This exercise provides template code for drawing several sketches of distributions, which you will find helpful in many later exercises.Use a computer package of your choice to complete the following questions. You will need the file 2_dist_sketching.ipynb if you use Python, or 2_dist_sketching.Rmd if you use R.
-
(a) You will find code that produces a sketch of the probability density functions of the
and distributions. Modify this code to produce a sketch of the probability density functions of the and distributions. -
(b) You will find code that produces a sketch of the
distribution. Modify this code to produce a sketch of the distribution. -
(c) In this question we look at distributions in the form of equation (2.4).
You will find code that produces a sketch of the discrete distribution with p.m.f.
for
. Note that this distribution is the sampling distribution associated to a discrete Bayesian model with model family and prior .Modify this code to produce a sketch of the discrete distribution with p.m.f.
for
.
-
-
2.2
Let be a discrete Bayesian model with model family where .We regard
as a model for the number of times an experiment fails before the experiment is successful. The probability of success on each try is , which is an unknown parameter. We assume that the experiments are independent of each other.-
(a) Write down the probability mass function
, and the range of this model. -
(b) Take a prior
. Given the single data point , show that the posterior distribution is given by . -
(c) Use a computer package of your choice to sketch the p.d.f. of this distribution, alongside the prior distribution.
-
(d) A second Bayesian update is made using a new data point,
. Find the new posterior distribution and add it to your sketch from (c). -
(e) Write down the p.m.f. of the predictive distribution, after the second update. Use a computer package of your choice to sketch it.
-
-
2.3
Let be a discrete Bayesian model with model family , where . Take the prior to be . Find the distribution of the posterior and write down the p.m.f. of the predictive distribution. -
2.4 Let
be a random variable with distributionfor
and , and zero otherwise.-
(a)
Find the marginal p.d.f. of and hence find the value of . -
(b)
Find the distribution of .
-