Jump to content

Metropolis–Hastings algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 155.140.123.250 (talk) at 06:04, 11 June 2002. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This algorithm can draw samples from any probability distribution P(x), requiring only that the density can be calculated at x. The algorithm generates a set of states xt which is a Markov chain because each state xt depends only on the previous state xt-1. The algorithm depends on the creation of a proposal density Q(xt,x') which depends on the current state xt and which can generate a new proposed sample x'. For example, the proposal density could be a Gaussian centred on the current state xt

Q(xt) ~ N(xt2I).

This proposal density would generate samples centred around the current state with variance σ2I. So we draw a new proposal state from Q(xt,x') and then calculate a value

a = a1 a2 a1 = P(x') / P(xt a2 = Q(xt;x') / Q(x';xt)