Metropolis–Hastings algorithm: Difference between revisions

Content deleted Content added
m =References=
Swapping x^t and x' in some places, guessing what it means
Line 6:
 
The Metropolis-Hastings 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';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 function]] centred on the current state x<sup>t</sup>
 
:<math>
Q( x^t'; x'^t ) \sim N( x'-x^t, \sigma^2 I).
</math> &nbsp; (Read Q(x';x<sup>t</sup>) as the probability of generating x' given the previous value x<sup>t</sup>.)
</math>
 
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 fromx' with probability Q(x';x<sup>t</sup>,x') and then calculate a value
 
:<math>