19.1. State-of-the-art MCMC implementations#

Here we present an (incomplete) list of state-of-the-art MCMC implementations and packages that are available in Python (and often other languages).

Individual libraries for MCMC sampling#

emcee:

emcee [FMHLG13] is an MIT licensed pure-Python implementation of Goodman & Weare’s Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler [GW10]

pocoMC:

pocoMC From the documentation:

  • pocoMC is a Python package for fast Bayesian posterior and model evidence estimation.

  • It leverages the Preconditioned Monte Carlo (PMC) algorithm, offering significant speed improvements over traditional methods like MCMC and Nested Sampling.

  • Ideal for large-scale scientific problems with expensive likelihood evaluations, non-linear correlations, and multimodality, pocoMC provides efficient and scalable posterior sampling and model evidence estimation.

  • Widely used in cosmology and astronomy, pocoMC is user-friendly, flexible, and actively maintained.”

zeus:

zeus is a Python implementation of the Ensemble Slice Sampling method. From the documentation:

  • Fast & Robust Bayesian Inference,

  • Efficient Markov Chain Monte Carlo (MCMC),

  • Black-box inference, no hand-tuning,

  • Excellent performance in terms of autocorrelation time and convergence rate,

  • Scale to multiple CPUs without any extra effort,

  • Automated Convergence diagnostics.

PyMultiNest:

PyMultiNest interacts with MultiNest [FHB09], a Nested Sampling Monte Carlo library.

ptemcee

ptemcee From the documentation: “ptemcee, pronounced “tem-cee”, is fork of Daniel Foreman-Mackey’s emcee to implement parallel tempering more robustly. As far as possible, it is designed as a drop-in replacement for emcee. If you’re trying to characterise awkward, multi-modal probability distributions, then ptemcee is your friend. “ This repository is archived (frozen) and unmaintained.

Full packages for inference (including sampling)#

PyMC:

PyMC is a Python package for Bayesian statistical modeling and probabilistic machine learning which focuses on advanced Markov chain Monte Carlo and variational fitting algorithms.

PyStan:

PyStan provides an interface to Stan, a package for Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo.

Bilby:

Bilby is a Bayesian inference library. From the documentation: “The aim of bilby is to provide a user-friendly interface to perform parameter estimation. It is primarily designed and built for inference of compact binary coalescence events in interferometric data, but it can also be used for more general problems.” Bilby provides a common interface to a wide range of samplers, including all of those listed in the first section above.