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 (360) for students in STA 360 and Homework 2 (602) for students in STA 602.
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.
Part (a): Find the Jeffreys’ prior density for \(\theta\). Recall that for single parameter models, the Jeffreys’ prior is \(\pi(\theta) \propto \sqrt{\mathcal{I}(\theta)}\), where \(\mathcal{I}(\theta)\) is the Fisher information for \(\theta\). Use one of the two definitions of Fisher information on the slides to find \(\mathcal{I}(\theta)\), then set \(\pi(\theta) \propto \sqrt{\mathcal{I}(\theta)}\).
(2 points for all students)
Suppose we have \(n\) independent observations \(Y = (y_1,y_2,\ldots,y_n)\), where each \(y_i \sim \mathcal{N}(\theta, \sigma^2)\), and the parameters \(\theta\) and \(\sigma^2\) are unknown. Jeffreys’ prior for \(\theta\) and \(\sigma^2\) (jointly) is \[\pi(\theta,\sigma^2) \propto (\sigma^2)^{-3/2}.\] Derive the posterior under this prior and state whether it is proper. What happens when \(n=1\) versus \(n>1\)?
(2.5 points for all students)
You can either integrate directly to confirm it is proper (you probably shouldn’t), or try to put it into a form of a distribution or combination of distributions you can try to recognize (just like we have been doing in class). Also, do this in terms of the variance not the precision, i.e., keep the normal likelihood in terms of the variance before combining it with the prior.
Hoff problem 5.2.
(Students in STA 360: 3.5 points; Students in STA 602: 3 points)
Part (a): 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?
(1 point)
Part (b): In addition, calculate the posterior probability that \(\theta_2 < 1.5\) in each case.
(0.5 points)
Part (c): 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\)?
(1 point)
20 points.