This assignment involves some probability review and one parameter models. 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 1 (360) for students in STA 360 and Homework 1 (602) for students in STA 602.
Show that the posterior variance of the beta-binomial model can be written as \[\mathbb{V}(\theta | y) = \dfrac{\mathbb{E}(\theta | y)\mathbb{E}(1-\theta | y)}{a+b+n+1}.\]
(2.5 points for all students)
Don’t work out part (a), just say what the correct sampling distribution is (you should already know) and move on to the remaining parts.
Continuation of the “new agent” example from class. For each of the priors (that is, Beta(1,666), Beta(0.05,33.33), Beta(1.6, 407.4), Beta(1.05, 497), and Unif(0,0.1)), how many trials would we need, assuming no adverse reactions, to be 95% sure that the new agent is as safe as (or safer than) the old one? That is, what value of \(n\) is required to ensure that \(\Pr(\theta_N \leq 0.0015| y) = 0.95\)?
(Students in STA 360: Skip; Students in STA 602: 3 points)
You don’t need to do any rigorous math here. Do it in R!
Hoff 3.2.
(Not graded. Attempt for practice but you don’t need to submit!)
Refer back to pages 5 to 7 of the Hoff book (the section on sensitivity analysis) if you are not sure what to do.
Total: 20 points.