# Metropolis-Hastings algorithm

1. May 2, 2005

### Zaare

I'm having trouble understanding how to find an expression for $$\pi(x)$$ and $$\pi(y)$$ in the relation:
$$\alpha \left( {x,y} \right) = \min \left( {1,\frac{{\pi \left( y \right)q\left( {y,x} \right)}}{{\pi \left( x \right)q\left( {x,y} \right)}}} \right)$$
For example, If I want to simulate Normal Distribution (Expectation value m and standard deviation s), how can I find expressions for $$\pi(x)$$ and $$\pi(y)$$? Or are they equal: $$\pi(x)=\pi(y)$$?

2. May 2, 2005

### juvenal

I've never used this algorithm, but the values of x and y are calculated/generated according to the algorithm and are different. One of the values, depending on how you are defining x and y, should come from the proposal distribution.

And pi(x) = the normal distribution probability of x, for your particular example.

3. May 3, 2005

### Zaare

I see. I was hopeing I could find a "short cut" which would simplify the expression for pi(x), but I suppose I can't.
Thanks for the help.