Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2001/iii/paper-33/2/i/solution

For the Metropolis–Hastings algorithm, start at a point with positive target probability density function. Draw from a proposal probability density function , generate an independent uniform distribution value , and set the next state to if
Otherwise retain , including that repeated state in the sample. Where a proposed forward move is possible but its reverse probability density function vanishes, its acceptance probability is zero. Unknown normalizing constants in cancel.
For distinct states, the accepted probability flow is
which is symmetric in . This detailed balance identity, together with the holding probability, proves that is invariant. Under appropriate irreducibility and aperiodicity conditions the chain converges to ; successive states are generally dependent.
The Gibbs sampler updates coordinates from their full conditional distributions. In a systematic sweep, draw successively
Each update preserves the target joint law: integrating the old coordinate against its conditional probability density function and replacing it by an independent draw from that same conditional leaves the joint probability density function unchanged. The composition of the coordinate updates therefore also preserves . A Gibbs sampler coordinate move can be regarded as a Metropolis–Hastings algorithm move with acceptance probability one. Systematic sweeps preserve stationarity but need not themselves be reversible. Initialization away from stationarity requires convergence before treating the draws as approximately target-distributed, and dependence must be accounted for in Monte Carlo method error estimates.

New to topics? Read the docs here!