20 Activity 2

The purpose of this activity is to explore and reinforce concepts in Chapters 1-3 of Bringing Bayesian Models to Life.

You are encouraged to work with others students in the class to complete this activity.

For this activity let [a] be a beta distribution with α=2 and β=1 (i.e., abeta(α=2,β=1)).

  1. Solve the integral 10[a]da analytically (i.e., using pencil and paper).

  2. Approximate the integral 10[a]da numerically using the quadrature method with m=40 equally spaced support points (see pg. 12 in BBM2L).

  3. Approximate the integral 10[a]da using Monte Carlo integration with K=100 draws (see pg. 18 in BBM2L).

  4. Write 3-5 sentences comparing the results you obtained in questions 1-3 and explain why the analytical and numerical results differ.

  5. Solve the integral 10a[a]da analytically. Verify that your answer matches that of the expected value of a beta distribution with α=2 and β=1.

  6. Approximate the integral 10a[a]da numerically using the quadrature method with m=40 equally spaced support points.

  7. Approximate the integral 10a[a]da using Monte Carlo integration with K=100 draws.

  8. This is probably a trick question. Solve the integral 10log(1sin(a))[a]da analytically.

  9. This is not a trick question. Approximate the integral 10log(1sin(a))[a]da using Monte Carlo integration with K=100 draws.