Metropolis–Hastings algorithm: Difference between revisions

Content deleted Content added
Formal derivation: removing one notation that is not used anywhere
Intuition: initial point should be called x_t, because further we reference it as x_t
Line 27:
Let <math>f(x)</math> be a function that is proportional to the desired probability distribution <math>P(x)</math> (a.k.a. a target distribution).
 
# Initialization: Choose an arbitrary point <math>x_0x_t</math> to be the first sample, and choose an arbitrary probability density <math>g(x|y)</math> (sometimes written <math>Q(x|y)</math>) that suggests a candidate for the next sample value <math>x</math>, given the previous sample value <math>y</math>. For the Metropolis algorithm, <math>g</math> must be symmetric; in other words, it must satisfy <math>g(x|y) = g(y|x)</math>. A usual choice is to let <math>g(x|y)</math> be a [[Gaussian distribution]] centered at <math>y</math>, so that points closer to <math>y</math> are more likely to be visited next—making the sequence of samples into a [[random walk]]. The function <math>g</math> is referred to as the ''proposal density'' or ''jumping distribution''.
# For each iteration ''t'':
#* '''Generate''' : Generate a candidate <math>x'</math> for the next sample by picking from the distribution <math>g(x'|x_t)</math>.