Skip to content

emcee : The MCMC Hammer

David W. Hogg

Publications of the Astronomical Society of the Pacific · 2013 · 12,405 citationsOpen access

Abstract

We introduce a stable, well tested Python implementation of the affine-invariant ensemble sampler for Markov chain Monte Carlo (MCMC) proposed by Goodman & Weare ( 2010 ). The code is open source and has already been used in several published projects in the astrophysics literature. The algorithm behind emcee has several advantages over traditional MCMC sampling methods and it has excellent performance as measured by the autocorrelation time (or function calls per independent sample). One major advantage of the algorithm is that it requires hand-tuning of only 1 or 2 parameters compared to ∼ N 2 for a traditional algorithm in an N -dimensional parameter space. In this document, we describe the algorithm and the details of our implementation. Exploiting the parallelism of the ensemble method, emcee permits any user to take advantage of multiple CPU cores without extra effort. The code is available online at http://dan.iel.fm/emcee under the GNU General Public License v2.

Cite this paper

Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. (2013). emcee : The MCMC hammer. Publications of the Astronomical Society of the Pacific, 125(925), 306–312. https://doi.org/10.1086/670067

Read it with every claim anchored

Add this paper to a project, ask questions of it, and get answers that point to the exact passage.

Start free
  1. A smooth particle mesh Ewald method1995
  2. Maps of Dust Infrared Emission for Use in Estimation of Reddening and Cosmic Microwave Background Radiation Foregrounds1998
  3. Planck 2018 results2020
  4. The Two Micron All Sky Survey (2MASS)2006
  5. Planck 2015 results2016

Metadata from OpenAlex (CC0). Citations are generated from the published record.