MCMC MCMC: Congratulations! You Passed!
MCMC MCMC: Congratulations! You Passed!
MCMC MCMC: Congratulations! You Passed!
Module Overview
Congratulations! You passed! GRADE
Reading: Module 2
QUIZ • 45 MIN TO PASS 80% or higher
Keep Learning
80%
assignments and materials
MCMC
3 min
4. Metropolis-Hastings
Video: Algorithm
9 min
MCMC
Video: Demonstration LATEST SUBMISSION GRADE
10 min
80%
Video: Random walk Submit your assignment
Try again
example, Part 1 DUE DATE Jan 18, 1:59 AM CST ATTEMPTS 4 every 8 hours
12 min 1. For Questions 1 through 3, consider the following model for data that take on values between 0 and 1: 1 / 1 point
8 questions where α and β are independent a priori. Which of the following gives the full conditional density for α up to
proportionality?
Reading: Code for Lesson 4
Γ(α+β)n α−1
p(α ∣ β, x) ∝ Γ(α)n
[∏ni=1 xi ] αa−1 e−bα I(0<α<1)
JAGS
α−1
Video: Download, install, p(α ∣ β, x) ∝ [∏ni=1 xi ] αa−1 e−bα I(α>0)
setup
Γ(α+β)n α−1 β−1
3 min p(α ∣ β, x) ∝ Γ(α)n Γ(β)n
[∏ni=1 xi ] [∏ni=1 (1 − xi )] αa−1 e−bα β r−1 e−sβ I(0<α<1) I(0<β<1)
Video: Model writing, Γ(α+β)n α−1
running, and post-
p(α ∣ β, x) ∝ Γ(α)n
[∏ni=1 xi ] αa−1 e−bα I(α>0)
processing
12 min
Correct
Reading: Alternative MCMC
software When we treat the data and β as known constants, the full joint distribution of all quantities x, α, and β is
10 min proportional to this expression when viewed as a function of α.
5. Gibbs Sampling 2. Suppose we want posterior samples for α from the model in Question 1. What is our best option? 1 / 1 point
α∗
Γ(α)n Γ(α∗ +β)n [∏ni=1 xi ] q(α∗ ∣α)Iα∗ >0
Γ(α∗ )n Γ(α+β)n [∏ni=1 xi ] q(α∣α∗ )Iα>0
α
Correct
All of the terms involving only β are identical in the numerator and denominator, and thus cancel out. The
acceptance ratio is the same whether we use the full joint posterior or the full conditional in a Gibbs sampler.
4. For Questions 4 and 5, re-run the Metropolis-Hastings algorithm from Lesson 4 to draw posterior samples from the model 1 / 1 point
for mean company personnel growth for six new companies: (-0.2, -1.5, -5.3, 0.3, -0.8, -2.2). Use the same prior as in the
lesson.
Below are four possible values for the standard deviation of the normal proposal distribution in the algorithm. Which one
yields the best sampling results?
0.5
1.5
3.0
4.0
Correct
The candidate acceptance rate for this proposal distribution is about 0.3 which yields good results.
5. Report the posterior mean point estimate for μ, the mean growth, using these six data points. Round your answer to two 0 / 1 point
decimal places.
.015
Incorrect
After running the code provided in Lesson 4, approximate the posterior mean of μ by taking the average of the
MCMC samples.