# Decision Rule for Random-Walk Metropolis on Log Scale

I need to sample from a non-standard density which is more tractable on the log-scale. Now I was wondering, how the decision rule is restated: $$\alpha (x' | x ) = min(1,\frac{\pi(x')}{\pi(x)})$$ with $x'$ being a candidate draw from a symmetric proposal distribution.

Is it correct to infer the following decision rule: $$\tilde{\alpha} = log(\alpha(x'|x)) = min(0, log(\pi(x')) - log(\pi(x)))$$ Accept Draw $x'$ if $\tilde{\alpha} \geq log(u)$ with $u\sim\mathcal{U}(0,1)$

• Yes this is correct. – Xi'an Oct 24 '16 at 19:38

Also it is not necessary to actually compute the minimum, i.e. you can accept if $$\log(u) \le \log(\pi(x')) - \log(\pi(x)).$$
In addition, you can avoid drawing the uniform and computing its log any time that $$\log(\pi(x')) \ge \log(\pi(x))$$ since $\log(u)$ is always less than the difference $\log(\pi(x')) - \log(\pi(x))$.
• Does that mean I accept the draw if $log(\pi(x')) \geq log(\pi(x))$ ? – mscnvrsy Oct 24 '16 at 19:54