Software for MCMC

If you’ve decided to join the increasing number of people using MCMC methods to conduct Bayesian inference, then one important decision is which software to use. This decision will be influenced by your programming language of choice, see Figure below.

MCMC options

If you use Matlab, then really your best choice at the moment is JAGS. You use it with the matjags utility. I have used Matlab and JAGS on two projects(submitted) so far and I can say it’s a solid, reliable, and easy to use. There is a Matlab/Stan interface, but as far as I can tell this is in development stages and their may be some wrinkles to iron out.

If you are an R user, then a RStan interface is offered by the actual developers of STAN. While STAN uses more fancy MCMC algorithms and is reported to be much faster / more efficient, I would not ignore JAGS. JAGS has a simpler modelling language, so it could remain a good place to start.

As I’ve mentioned in earlier posts, I am transitioning over to Python as my go-to language. As such I will probably be saying goodbye to JAGS, and saying hello to either PySTAN, PyMC, or emcee. There is an excellent in-depth comparison by Jake Vanderplas, but I am currently learning PyMC. To get a really quick overview of how simple it is, you can check out my IPython notebook.

To end up with, I would recommend this intro talk to PyMC by Chris Fonnesbeck who also gives a nice concise history of the software packages available.