Now we compute , which is also 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 . If , 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 .
- If , then gets "accepted" and becomes our next sample .
- If , then we use our old as our next sample and try again.
Now we compute , which is also 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 . If , 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 .
- If , then gets "accepted" and becomes our next sample .
- If , then we use our old as our next sample and try again.