Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler

Welcome!

Emcee is very easy to use from an API standpoint, but it is just an sampler, not a full-blown probabilistic programming language (PPL). You just build a function that takes parameter values and returns a log posterior probability (likely built in in python, likely with help from numpy and scipy.stats), pass that function to emcee, and you’re pretty much good to go. I don’t know of any particular advantages to ensemble sampling (which is not to say there aren’t any), but it does have a reasonably well-known problem with moderate- to high-dimensional models. So it really depends on what you need. If you are looking to closely replicate the procedure, emcee seems like a good choice. If you are just looking to recreate the model, but you are interested in a) using a PPL that makes model-building relatively easy and b) a wide-variety of sampling tools and convenience functions, then PyMC is much more full-featured.

[edit: should have mentioned that the affine invariance is a definite benefit if you have skewed/poorly scaled distributions, but maybe that 's evident from the name?]

2 Likes