Suppose we have the following set-up and we conduct an MCMC on it.


$$ X\sim ~ Gamma(\alpha,\beta) $$


$$ \alpha \sim Unif(0,10) $$ $$ \beta \sim Gamma(0.5,0.5) $$

Assume the MCMC over $M$ iterations gives us estimates of $\alpha$ and $\beta$ where $\widehat{\alpha} = (\alpha_1, \ldots, \alpha_M)$ and $\widehat{\beta} = (\beta_1, \ldots, \beta_M)$.

Assume we iteratively for $i = \{1, \ldots, M\}$:

  • Take $\alpha_i$ and $\beta_i$ and sample a value of $x_i \sim Gamma(\alpha_i,\beta_i)$

If we plot the density of these $(x_1, \ldots, x_M)$, what is it approximating? Is it the posterior predictive?


1 Answer 1


Yes, this is called the posterior predictive distribution. Mathematically, the histogram is approximating the following distribution

$$ p(\tilde{y} \vert y) = \int p(\tilde{y} \vert \theta) p(\theta \vert y) \, d\theta$$

You'll note the first part of the integrand is the likelihood and the second is the posterior. This integral is integrating over all $\theta$ drawn from the posterior and plugged into the likelihood.

  • $\begingroup$ Thanks. For my procedure above, the $\alpha$ and $\beta$ to be plugged into the likelihood is taken iteratively. Is it necessary for me to sample $\alpha$ and $\beta$ randomly before plugging in? Is there a difference between randomly sampling the posterior parameters vs. taking them one by one iteratively up to $M$? Thanks! $\endgroup$
    – user321627
    Feb 20, 2020 at 5:47
  • 1
    $\begingroup$ If you've obtained the alpha and beta through MCMC, then they are considered pseudorandom draws from the posterior and you can perform the procedure iteratively. $\endgroup$ Feb 20, 2020 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.