Session Ready
Exercise

The normal posterior

In our reaction time example, my friend John thinks I have pretty good reflexes and assigns a normal prior for M with mean 240 and standard deviation 15.

Suppose that in 10 plays of the game, my mean score is ybar = 275.9 ms with a standard error of se = 6.32.

You can use the normal_update() function to find the posterior mean and standard deviation given the prior (vector of mean and standard deviation) and data (sample mean and standard error).

normal_update(c(240, 15), c(275.9, 6.32))

The figure to the right shows John's prior (blue) and posterior (red) curves.

Instructions
100 XP

Suppose Kathy has a different opinion about my mean reaction time. Kathy's prior for M is normal with mean 260 and standard deviation 10.

  • Define a vector Data containing the sample mean and standard error.
  • Define a vector Prior with the mean and standard deviation of the prior.
  • Use the normal_update() function to find the mean and standard deviation of the posterior. Assign the result to Posterior.
  • Use the many_normal_plots() function to construct a plot of the prior and posterior curves. The input to many_normal_plots() is a list where each list element is a vector of the mean and standard deviation for a normal curve.