Monday, December 6, 2010

MCMC 3

Sorry to belabor this, but I think I've got it finally. (Previous posts on MCMC here and here). Suppose we have a method of generating the proposal density, call it Q. Detailed balance (Metropolis) would say that we must have:

Q(Mj|Mi) = Q(Mi|Mj)

But we may want to implement a method Q that leads to more efficient exploration of the tree space, say by restricting changes in the phylogenetic tree to nearest neighbor interchanges (NNI) most of the time. And suppose that in implementing Q, we know that:

Q(Mj|Mi) ≠ Q(Mi|Mj)

If we can calculate a value for that ratio (between forward and backward moves), then we can divide the acceptance ratio by this "bias" (my term) and get the correct distribution in our samples.

Now the wikiepedia article on Metropolis Hastings makes complete sense. Having the right form of Q is critical for the success of the method, and the acceptance rate is monitored to achieve that. Another issue is to sample but not get trapped on peaks of density; that is where simulated annealing comes in.

It would be nice to see an example of how you would calculate this ratio for Q.