It can be shown that, over time, the list of samples will asymptotically match samples drawn from : in the long run, this algorithm is completely correct.
Let me take a second to break this last step down and give a motivation for why this algorithm converges: feel free to skip this part if the math seems hairy.
We always move towards a new point that is more likely, and occasionally we make moves to a less likely location. Imagine we have two points and : over a long time, roughly how often will and appear in our list of samples relative to each other? For the sake of argument, we will assume that .
- The chance we go from to is . It's the chance we propose multiplied by the chance we then accept , which is .
- The chance we go from to is , because once we propose we accept it with an 100% probability. We're assuming that is symmetric.
It can be shown that, over time, the list of samples will asymptotically match samples drawn from : in the long run, this algorithm is completely correct.
Let me take a second to break this last step down and give a motivation for why this algorithm converges: feel free to skip this part if the math seems hairy.
We always move towards a new point that is more likely, and occasionally we make moves to a less likely location. Imagine we have two points and : over a long time, roughly how often will and appear in our list of samples relative to each other? For the sake of argument, we will assume that .
- The chance we go from to is . It's the chance we propose multiplied by the chance we then accept , which is .
- The chance we go from to is , because once we propose we accept it with an 100% probability. We're assuming that is symmetric.