Session Ready
Exercise

Posterior predictive distribution

The weight_chains data frame (in your workspace) contains your 100,000 posterior predictions, Y_180, for the weight of a 180 cm tall adult:

> head(weight_chains, 2)
          a        b        s iter    m_180    Y_180
1 -113.9029 1.072505 8.772007    1 79.14803 71.65811
2 -115.0644 1.077914 8.986393    2 78.96014 75.78893

You will use these 100,000 predictions to approximate the posterior predictive distribution for the weight of a 180 cm tall adult. The bdims data are in your workspace.

Instructions
100 XP
  • Use the 10,000 Y_180 values to construct a 95% posterior credible interval for the weight of a 180 cm tall adult.
  • Construct a density plot of your 100,000 posterior plausible predictions.
  • Construct a scatterplot of the wgt vs hgt data in bdims.
    • Use geom_abline() to superimpose the posterior regression trend.
    • Use geom_segment() to superimpose a vertical line at a hgt of 180 that represents the lower & upper limits (y and yend) of ci_180.