MCMC - Monte Carlo Markov Chain
Intro
This video gives good description of how does MCMC sampling works. What's described in this video is MetropolisāHastings algorithm - which is a type of MCMC sampling method.
What does MCMC do?
Let's say you have a pdf. Actually let's loosen the assumption, let's say you a function that's proportional to pdf, which is basically called unnormalised pdf. Then how can you draw samples from it?
MCMC is sampling method. In MCMC, you sample sequence of points (hence a markov chain), where sample at each step is depend on the previous sample. Then when you plot all the samples in the chain, you will get a histogram that looks like the pdf.
Deriving MCMC
Let's say we will have a chain, . Now what we want is that these samples will induce stationary distribution, ie at , the distribution will stop chaning.
At that instance we can use, fixed points theorem. It at equillibrium, we will have following equations hold true. Consider two states, and . So now let's say we have stationary distribution , ie we will have two probabilities and .
Now what we are interested is finding the transition probabilities, that's what defines the Markov Chain, so probabilities and . Note that since we are only considering two states and similarly for .
So now at equillibrium, we can write following for the stationary distribution.
Basically, in the above eqn, we write that probability of being in state is equal to: probability in being state x and then transition from x to y, or being already in state y and transition from y to y.
On reducing the above eqn, we will get
The two quanties on LHS and RHS are net probaility of [being in y and going to x from y] and [being in x and going to y from x] respectively.
Can we seen as : In equilibrium, the "flow" from state x to state y should equal the flow from y to x.
You can write similar equation for , and would get at the same result.
What we saw above is the fixed point equation, which generally is used for systems in terminal/ equilibrium state. For all states, the equation is written as follows.
where is the stationary distribution and is the transition probability distribution.
Demos
Resources
Last updated