3

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)$

mscnvrsy
  • 515
  • 6
  • 15

1 Answers1

3

Yes this is correct.

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))$.

jaradniemi
  • 4,451
  • 13
  • 25