When I'm coding a Monte Carlo simulation for some problem, and the model is simple enough, I use a very basic textbook Gibbs sampling. When it's not possible to use Gibbs sampling, I code the textbook Metropolis-Hastings I've learned years ago. The only thought I give to it is choosing the jumping distribution or its parameters.

I know there are hundreds and hundreds of specialized methods that improve over those textbook options, but I usually never think about using/learning them. It usually feels like it's too much effort to improve a little bit what is already working very well.

But recently I've been thinking if maybe there aren't new general methods that can improve over what I've been doing. It's been many decades since those methods were discovered. Maybe I'm really outdated!

Are there any well known alternatives to Metropolis-Hastings that are:

  • reasonably easy to implement,
  • as universally appliable as MH,
  • and always improves over MH's results in some sense (computational performance, accuracy, etc...)?

I know about some very specialized improvements for very specialized models, but are there some general stuff everybody uses that I don't know?

  • 1
    $\begingroup$ Do you mean Markov chain Monte Carlo? The textbook improvements to Monte Carlo simulations that I can think of involve antithetic and/or stratified sampling, as well as quasi-Monte Carlo. Your mentioning of only Gibbs and Metropolis-Hastings is indicative of Bayesian computing, though. $\endgroup$
    – StasK
    Commented Dec 26, 2012 at 17:59
  • $\begingroup$ @StasK, Yes, I'm mainly interested in bayesian models and statistical physics models (which is just bayesian inference on gibbs-like distributions p(x) = 1/Z exp(-E(x)/T) ). Sorry for failing to mention that. $\endgroup$ Commented Dec 26, 2012 at 18:01
  • 3
    $\begingroup$ (+1) OK, a nice general-purpose adaptive algorithm "recently" published and already implemented in R, Python and Matlab is the twalk. It works well but it is always a good practice to double-check using another method. BTW, MH is implemented in the R package mcmc. Of course, there are many others but most of them are not implemented in this level of generality and/or they are difficult to implement. Another popular area nowadays is Sequential Monte Carlo. I hope this helps. $\endgroup$
    – user10525
    Commented Dec 26, 2012 at 18:20
  • 2
    $\begingroup$ You may already know this, but slice sampling is pretty easy to implement and avoids some pitfalls of a typical "random-walk" Metropolis algorithm. A problem with traditional Metropolis algorithms is random-walk type behaviour; rather than move purposefully towards good states, they stumble around, moving slowly to the good areas. This is the motivation behind methods that make use of information in the gradient, such as HMC, but slice sampling also falls into this camp and is more automatic. $\endgroup$
    – guy
    Commented Dec 26, 2012 at 21:54
  • 1
    $\begingroup$ I know almost nothing about ABC, but I would be glad if anyone could explain a bit about the differences between ABC and MCMC methods... $\endgroup$ Commented Dec 31, 2012 at 16:45

1 Answer 1


I'm not an expert in any of these, but I thought I'd put them out there anyway to see what the community thought. Corrections are welcome.

One increasingly popular method, which is not terribly straightforward to implement, is called Hamiltonian Monte Carlo (or sometimes Hybrid Monte Carlo). It uses a physical model with potential and kinetic energy to simulate a ball rolling around the parameter space, as described in this paper by Radford Neal. The physical model takes a fair amount of computational resources, so you tend to get many fewer updates, but the updates tend to be less correlated. HMC is the engine behind the new STAN software that is being developed as a more efficient and flexible alternative to BUGS or JAGS for statistical modeling.

There's also a whole cluster of methods that involve "heating up" the Markov chain, which you can think of as introducing thermal noise to the model and increasing the chances of sampling low-probability states. At first glance, that seems like a bad idea, since you want the model to sample in proportion to the posterior probability. But you actually only end up using the "hot" states to help the chain mix better. The actual samples are only collected when the chain is at its "normal" temperature. If you do it correctly, you can use the heated chains to find modes that an ordinary chain wouldn't be able to get to because of large valleys of low probability blocking the transition from mode-to-mode. A few examples of these methods include Metropolis-coupled MCMC, tempered transitions, parallel tempering, and annealed importance sampling.

Finally, you can use sequential Monte Carlo or particle filtering when the rejection rate would be so high that these other methods would all fail. I know the least about this family of methods, so my description may be incorrect here, but my understanding is that it works like this. You start out by running your favorite sampler, even though the chances of rejection are essentially one. Rather than rejecting all your samples, you pick the least objectionable ones, and initialize new samplers from there, repeating the process until you find some samples that you can actually accept. Then you go back and correct for the fact that your samples were nonrandom, because you didn't initialize your samplers from random locations.

Hope this helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.