Chib, Siddhartha and Edward Greenberg (1995): “Understanding the Metropolis Hastings Algorithm,” American Statistical Journal, 49, 327–335.
@Article{chib95understanding,
author = {Siddhartha Chib and Edward Greenberg},
title = {Understanding the {Metropolis-Hastings} Algorithm},
journal = {American Statistical Association},
year = 1995,
volume = 49,
pages = {327--335}
}
The Metropolis-Hastings algorithm is a Markov chain Monte Carlo method developed by Metropolis, Rosenbluth, Rosenbluth, Teller, and Teller (1953) and generalized by Hastings (1970). This algorithm is very general and gives rise to the Gibbs sampler as a special case. This article provides a self-contained intuitive development of the algorithm from first principles. The paper focuses on absolutely continuous target densities, but the algorithm also applies to discrete and mixed distributions.
Classical sampling methods typically generate independent samples. One such method is the A-R method. The objective is to sample from an absolutely continuous target density , where , is the unnormalized target density, and the potentially unknown normalizing constant. Suppose that we can sample from another density and that there exists a constant such that for all . To obtain a draw from :
The expected number of iterations required to accept a draw is . To ensure efficiency, the optimal choice of is
Consider a Markov transition kernel for and , where is the Borel -algebra on . Two major concerns in Markov chain theory are whether there exists an invariant distribution and whether iterating the transition kernel converges to the invariant distribution. The invariant distribution satisfies
where is the density of with respect to Lebesgue measure. Let
denote the -th iteration of the transition kernel. Conditions are described under which converges to as . That is, the distribution of the draws generated by the iterations is approximately .
MCMC methods look at the problem from the opposite perspective. The invariant distribution is known (the target distribution). The problem is how to generate an appropriate transition kernel with the aforementioned convergence property. Suppose that the transition kernel can be expressed as
where , if and otherwise, and define . The term represents the probability of staying at which may be nonzero. If this kernel satisfies the reversibility condition
then is the invariant distribution of . The Metropolis-Hastings algorithm generates a with this property.
Let denote the candidate-generating density, where . This is essentially the conditional density of given . This density could potentially be used as the term in the transition kernel, but it may not satisfy (1). If, for example, we have
then we can adjust by using a probability of move . Transitions will be made using
for .
The choice of follows the following logic. If (2) holds, then moves from to are happening too often under . We should thus choose . But then, in order to satisfy (1), we must have
This implies that
Conversely, we can consider the case when the inequality in (1) were reversed to derive . Thus, to summarize, in order to satisfy reversibility, we set
Hence, the desired transition kernel is
Thus, the Metropolis-Hastings algorithm is defined by the candidate-generating density . Note that does not require knowledge of the normalizing constant because it drops out of the ratio . A special case arises when the candidate-generating density is symmetric: since the probability of move reduces to . This special case forms the basis for optimization algorithms such as Simulated Annealing.
The algorithm proceeds as follows: Given an initial value , for each