Metropolis–Hastings algorithm: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
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 x<sup>t</sup> which is a [[Markov chain]] because each state x<sup>t</sup> depends only on the previous state x<sup>t-1</sup>. The algorithm depends on the creation of a ''proposal density'' Q(x<sup>t</sup>,;x') which depends on the current state x<sup>t</sup> and which can generate a new proposed sample x'. For example, the proposal density could be a Gaussian centred on the current state x<sup>t</sup>
 
Q(x<sup>t</sup>;x') ~ N(x'-x<sup>t</sup>,&sigma;<sup>2</sup>I).
 
This proposal density would generate samples centred around the current state with variance &sigma;<sup>2</sup>I. So we draw a new proposal state from Q(x<sup>t</sup>,x') and then calculate a value