This assignment involves one parameter models and Monte Carlo approximations. Please make sure your final output file is a pdf document. You can submit handwritten solutions for non-programming exercises or type them using R Markdown, LaTeX or any other word processor. All programming exercises MUST be done in R, typed up clearly and with all code attached. Submissions should be made on gradescope: go to Assignments \(\rightarrow\) Homework 2.
Hoff 3.3
Hoff 4.1
Sample from the posterior distribution for women who are college educated using \(m\) = 10, 100, and 1000 Monte Carlo samples. For each \(m\), make a plot of the random draws and on the same plot, mark the points corresponding to the posterior mean and the 95% equal-tailed credible interval (quantile-based). How do those compare to the true posterior mean and 95% quantile-based CI?
In addition, calculate the posterior probability that \(\theta_2 < 1.5\) in each case.
How large should \(m\) be if \(95\%\) of the time we want the difference between the Monte Carlo estimate of the posterior mean and the true posterior mean (which we know in this case) to be \(\leq 0.001\)?
Hoff 4.8
You can find the data mentioned in the question here: http://www2.stat.duke.edu/~pdh10/FCBS/Exercises/. Clearly, you don’t need to download and load the data, you can just enter it manually in R.
20 points.