# Metropolis-Hastings algorithm

1. Mar 18, 2012

### kulimer

I digged out this old tread, but it is closed. I'll repost, but with my question.
https://www.physicsforums.com/showthread.php?t=74004&highlight=metropolis

$\pi(x)$

and
$\pi(y)$

and
$q(y,x)$ is the jump distribution

in the relation:
$\alpha(x,y)= \min \left( 1,\frac{\pi (y)q(y,x)}{\pi (x)q(x,y)} \right)$

Say, my jump distribution(aka transition prob) is normal(0,1). How do you write out $q(y,x)$? Is it $\frac{1}{\sqrt{2\pi }\sigma }{{e}^{\frac{{{(x-0)}^{2}}}{2{{\sigma }^{2}}}}}$?

But this doesn't make sense, because it doesn't involve y, since $q(y,x)$ means given y, the transition probability of getting x. We are suppose to relate y to x in the equation.

Last edited: Mar 18, 2012
2. Mar 19, 2012

### zli034

Variables x, y, z, in algebra, are place holders.

q(y,x)=normal(0,1) means y=0 x=1

Algebra is a incomplete story of placeholders. Be careful where you can plugin the values.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook