Instructions

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.

Questions

  1. Let \[y_1,\ldots,y_n \overset{iid}{\sim} \textrm{Ga}(a,b)\] where a is known (so we only wish to infer b).
    • Part (a): Find the conjugate family of priors for b.
      (1 point for all students)
    • Part (b): Find the corresponding posterior given the prior you identified in the previous part.
      (1 point for all students)
    • Part (c): Give an interpretation of the prior parameters as things like “prior mean”, “prior variance”, “prior sample size”, etc.
      (0.5 points for all students)
  2. Hoff 3.3
    • Part (a): 1 point for all students
    • Part (b): 1 point for all students
    • Part (c): 1 point for all students
  1. Hoff 4.8

    • Part (a): Students in STA 360: 1.5 points; Students in STA 602: 1 point
    • Part (b): Students in STA 360: 1.5 points; Students in STA 602: 1 point
    • Part (c): Students in STA 360: 1.5 points; Students in STA 602: 1 point
    • Part (d): Students in STA 360: 1.5 points; Students in STA 602: 1 point

    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.

  2. Jeffreys’ prior distributions (From BDA3). Suppose \(y|\theta \sim \textrm{Po}(\theta)\).

    • 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)

    • Part (b): What values of \(a\) and \(b\) for the gamma density \(\textrm{Ga}(a,b)\) will result in a close match to the Jeffreys’ density you found?
      (0.5 points for all students)

  3. 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.

  4. Hoff problem 5.2.
    (Students in STA 360: 3.5 points; Students in STA 602: 3 points)

  5. How many samples is enough? Recall the birth rates example from the slides.
    (Not graded for students in STA 360; you can attempt for practice but you don’t need to submit. Graded for students in STA 602)

    • 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)

Grading

20 points.