Practice the following exercises to reinforce the concepts learned in this chapter:
- Write a function that will take a vector holding MCMC samples for a parameter and plot a density curve depicting the posterior distribution and the 95% credible interval. Be careful of different scales on the y-axis.
- Fitting a normal curve to an empirical distribution is conceptually easy, but not very robust. For distribution fitting that is more robust to outliers, it's common to use a t-distribution instead of the normal distribution, since the t has heavier tails. View the distribution of the shape attribute of the built-in rock dataset. Does this look normally distributed? Find the parameters of a normal curve that is a fit to the data. In ...