Updating one piece at a time
Some posteriors are hard as a whole but easy one piece at a time. Gibbs sampling uses this. With two unknowns, say a mean and a precision (one over the variance), you do not need their joint distribution. Draw from its distribution given the current . Then draw from its distribution given the new . Repeat. Each draw is a conditional draw, and it is always accepted: unlike Metropolis-Hastings there is no accept-or-reject step. The pairs you collect form a chain that explores the joint posterior.
Gibbs works best when the pieces are not tied tightly together. If two unknowns are strongly correlated, each conditional draw can only take a tiny step along the narrow ridge, so the chain zigzags and moves slowly. A two-variable example: if and are bivariate normal with correlation , then given is normal with mean and standard deviation . With and the draw of has mean and standard deviation . With the standard deviation drops to and the steps become tiny.
- Gibbs sampling: draw each unknown in turn from its conditional distribution given the others.
- No rejection: every conditional draw is kept, but you need each conditional to be easy to draw from.
- Strong correlation between unknowns makes the chain zigzag and mix slowly.
Lab · what's graded
- A conditional mean15 pts
- A conditional spread10 pts
- Drawing the mean15 pts
- Drawing the precision15 pts
- No rejection step10 pts
- One sweep10 pts
- Match the vocabulary10 pts
- Strong correlation slows Gibbs15 pts