Session Ready
Exercise

Posterior simulation

In our quest to learn about my average reaction time M, John's posterior density is normal with mean 270.5 ms and standard deviation 5.8 ms.

Similar to the proportion situation, you can use rnorm() to simulate from the posterior of the population mean—the resulting values are stored in the vector M_sim. The graph on the right displays a histogram of the simulated values created using the hist() function.

Instructions
100 XP
  • Simulate 1000 values from John's posterior density for M. Assign the result to M_sim.
  • Use the simulated values to compute the posterior standard deviation.
  • Use the simulated values to find the posterior probability that M < 260.
  • Use the simulated values to find a 70 percent probability interval for M.