14 Activity 4
The purpose of this activity is to explore and reinforce concepts in Chapter 4 and Chapter 6 of Bringing Bayesian Models to Life.
You may complete this assignment with a partner (i.e., max group size of 2 people). If you chose to work with a partner you only need to submit one assignment, but please make sure both of your names are on it. You may participate in a learning group of any size to complete the assignment, but please submit your own work.
You are encouraged to work with others students in the class to complete this activity.
For all questions in this assignment let \([a]\) be a beta distribution with \(\alpha=2\) and \(\beta=1\) (i.e., \(a\sim\text{beta}(\alpha=2,\beta=1)\)).
Use a Metropolis-Hastings algorithm to draw 5000 samples from \([a]\) (see bottom of pg. 25 in BBM2L). For this example, use a so-called walk or Metropolis proposal (see section 4.3 on pgs. 33-35) with \(\sigma^2_{\text{tune}}=0.0001\). Before you start this problem write out and simplify the Metropolis-Hastings ratio. Show all of your steps for this.
Discard the first 1000 samples from the 5000 Monte Carlo samples you drew in question 1. Then calculate the mean of the remaining 4000 samples you drew in question 1. Although it might not be obvious, you are implicitly approximating an integral. Write out the integral that you are approximating.
Use a Metropolis-Hastings algorithm to draw 5000 samples from \([a]\) (see bottom of pg. 25 in BBM2L). For this example, use a so-called walk or Metropolis proposal (see section 4.3 on pgs. 33-35) with \(\sigma^2_{\text{tune}}=0.25\). Before you start this problem write out and simplify the Metropolis-Hastings ratio. Show all of your steps for this.
Discard the first 1000 samples from the 5000 Monte Carlo samples you drew in question 3. Then calculate the mean of the remaining 4000 samples you drew in question 3. Although it might not be obvious, you are implicitly approximating an integral. Write out the integral that you are approximating.
Use a Metropolis-Hastings algorithm to draw 5000 samples from \([a]\) (see bottom of pg. 25 in BBM2L). For this example, use a so-called walk or Metropolis proposal (see section 4.3 on pgs. 33-35) with \(\sigma^2_{\text{tune}}=10\). Before you start this problem write out and simplify the Metropolis-Hastings ratio. Show all of your steps for this.
Discard the first 1000 samples from the 5000 Monte Carlo samples you drew in question 5. Then calculate the mean of the remaining 4000 samples you drew in question 3. Although it might not be obvious, you are implicitly approximating an integral. Write out the integral that you are approximating.
Compare the numerical values of the Monte Carlo approximation to the integrals in questions 2, 4, and 6. Write 3-5 sentences describing the differences (if any) between the approximation accuracy of the integrals with the three different proposal distributions.