Now we compute P(x)P(x)\frac{P(x')}{P(x)}, which is also P(x)P(x)\frac{P^*(x')}{P^*(x)} because the constants cancel. This is where the magic happens: computing ratios to cancel out the constant is the core idea of the algorithm and the part to remember. Call this ratio α\alpha. If α1\alpha \ge 1, then the new point is as likely or more likely than the old one.

We compute a random number between 0 and 1 and call it rr.

  • If rαr \le \alpha, then xx' gets "accepted" and becomes our next sample x1x_1.
  • If r>αr > \alpha, then we use our old x0x_0 as our next sample x1x_1 and try again.
plot

Now we compute P(x)P(x)\frac{P(x')}{P(x)}, which is also P(x)P(x)\frac{P^*(x')}{P^*(x)} because the constants cancel. This is where the magic happens: computing ratios to cancel out the constant is the core idea of the algorithm and the part to remember. Call this ratio α\alpha. If α1\alpha \ge 1, then the new point is as likely or more likely than the old one.

We compute a random number between 0 and 1 and call it rr.

  • If rαr \le \alpha, then xx' gets "accepted" and becomes our next sample x1x_1.
  • If r>αr > \alpha, then we use our old x0x_0 as our next sample x1x_1 and try again.
plot