pith. machine review for the scientific record. sign in

arxiv: 1202.3665 · v4 · submitted 2012-02-16 · 🌌 astro-ph.IM · physics.comp-ph· stat.CO

Recognition: 2 theorem links

· Lean Theorem

emcee: The MCMC Hammer

Daniel Foreman-Mackey, David W. Hogg, Dustin Lang, Jonathan Goodman

Pith reviewed 2026-05-13 21:55 UTC · model grok-4.3

classification 🌌 astro-ph.IM physics.comp-phstat.CO
keywords MCMCMarkov chain Monte Carloensemble samplerPythonastrophysicsBayesian inferenceparameter estimation
0
0 comments X

The pith

The emcee package implements an affine-invariant ensemble sampler for MCMC that requires tuning only one or two parameters.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

This paper presents emcee, a stable Python implementation of the affine-invariant ensemble Markov chain Monte Carlo sampler. The method allows sampling from posterior distributions in high-dimensional spaces with far less hand-tuning than traditional algorithms. It also supports parallel computation across multiple CPU cores to speed up the process. A sympathetic reader would care because it lowers the barrier to using MCMC for parameter estimation in scientific modeling.

Core claim

emcee is a Python implementation of the Goodman and Weare affine-invariant ensemble sampler for MCMC. It achieves excellent performance as measured by autocorrelation time while requiring hand-tuning of only one or two parameters instead of approximately N squared for an N-dimensional space. The code exploits the parallelism of the ensemble method to allow easy use of multiple processors.

What carries the argument

The affine-invariant ensemble sampler, which proposes moves based on the current positions of other walkers in the ensemble to maintain invariance under affine transformations.

If this is right

  • Users can apply MCMC methods to complex models in astrophysics with minimal parameter tuning.
  • The sampler can be run in parallel without additional coding effort.
  • Published projects have already used it, demonstrating its stability.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Similar ensemble methods could be adapted for other sampling algorithms beyond MCMC.
  • Integration with modern hardware like GPUs might further improve performance.

Load-bearing premise

That the affine-invariant ensemble method converges reliably to the true posterior distribution for arbitrary likelihood functions.

What would settle it

Demonstrating a likelihood function where the emcee sampler fails to converge or has very long autocorrelation times despite using the recommended settings.

read the original 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 $\sim 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 and API. 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 MIT License.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

0 major / 1 minor

Summary. The paper presents emcee, a stable and well-tested open-source Python implementation of the affine-invariant ensemble MCMC sampler introduced by Goodman & Weare (2010). It describes the algorithm, implementation details including parallelism via multiprocessing, the user API, and performance measured by autocorrelation time. The central claims are that the method requires hand-tuning of only 1-2 parameters (versus ~N² for traditional Metropolis-Hastings in N dimensions) and delivers efficient sampling, with the code already used in multiple published astrophysics projects.

Significance. If the reported stability, performance, and ease of use hold, this work supplies a practical, accessible tool that lowers the barrier for high-dimensional Bayesian inference in astrophysics. The open MIT-licensed code, documented usage in the literature, and exploitation of ensemble parallelism for multi-core performance constitute concrete strengths that directly benefit the community.

minor comments (1)
  1. Abstract: the URL for code availability should be supplemented with a permanent identifier (e.g., Zenodo DOI) to ensure long-term accessibility.

Simulated Author's Rebuttal

0 responses · 0 unresolved

We thank the referee for their positive review of the manuscript and their recommendation to accept. No major comments were raised in the report.

Circularity Check

0 steps flagged

No significant circularity; software implementation of prior algorithm

full rationale

This is a software description paper that implements the affine-invariant ensemble sampler proposed in the independent prior reference Goodman & Weare (2010). The central claims about reduced hand-tuning (1-2 parameters vs ~N²) and performance are directly inherited from that cited work without new derivation, fitting, or self-referential steps in the present manuscript. Implementation details, API, parallelism, and autocorrelation reporting are practical contributions backed by the open MIT-licensed code. No equations or results reduce by construction to the paper's own inputs; the derivation chain is external and the paper is self-contained against external benchmarks.

Axiom & Free-Parameter Ledger

0 free parameters · 1 axioms · 0 invented entities

The work rests on the established correctness of the 2010 ensemble sampler algorithm and standard MCMC convergence assumptions; no new free parameters or invented entities are introduced.

axioms (1)
  • domain assumption The affine-invariant ensemble sampler proposed by Goodman & Weare (2010) produces correct samples from the target distribution when properly implemented.
    Invoked throughout the description of the algorithm and its advantages.

pith-pipeline@v0.9.0 · 5461 in / 1189 out tokens · 33494 ms · 2026-05-13T21:55:44.300195+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Lean theorems connected to this paper

Citations machine-checked in the Pith Canon. Every link opens the source theorem in the public Lean library.

Forward citations

Cited by 24 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Dispersion Measure Distribution of Unlocalized Fast Radio Bursts as a Probe of the Hubble Constant

    astro-ph.CO 2026-04 unverdicted novelty 8.0

    The DM distribution of unlocalized FRBs yields H0 = 73.8 +14.0/-12.3 km/s/Mpc with 18% uncertainty.

  2. VLTI/PIONIER imaging of post-AGB binaries. An INSPIRING hunt for inner rim substructures in circumbinary discs

    astro-ph.SR 2026-05 unverdicted novelty 7.0

    High-resolution interferometric imaging of eight post-AGB circumbinary discs reveals diverse inner-rim substructures including azimuthal brightness enhancements and arc-like features not explained by inclination alone.

  3. Hidden Monsters with SPHEREx I: A goldmine for heavily reddened quasars at cosmic noon

    astro-ph.GA 2026-05 accept novelty 7.0

    SPHEREx data confirm 77 new luminous heavily reddened quasars at 1.5<z<3.9 that are hot-dust poor relative to unobscured quasars, supporting a blow-out feedback phase.

  4. Precision hyperfine spectroscopy of an individual nuclear-spin-9/2

    quant-ph 2026-05 unverdicted novelty 7.0

    An Er3+ spin sensor in CaWO4 measures the hyperfine NMR spectrum of a single 93Nb nuclear spin-9/2 with Hertz resolution, determining its site, position, quadrupolar tensor, and two new terms in the spin Hamiltonian.

  5. Measuring neutrino mass and asymmetry through galaxy pairwise peculiar velocity

    astro-ph.CO 2026-04 unverdicted novelty 7.0

    Galaxy pairwise peculiar velocities from Cosmicflows-4 yield M_ν = 0.24^{+0.34}_{-0.18} eV and η² = 2.14^{+0.30}_{-0.32} (7σ non-zero asymmetry) in the CMB framework, consistent with prior Planck results.

  6. Cosmologically viable non-polynomial quasi-topological gravity: explicit models, $\Lambda$CDM limit and observational constraints

    gr-qc 2026-04 unverdicted novelty 7.0

    Non-polynomial quasi-topological gravity models reproduce the standard thermal history, generate dynamical dark energy of geometric origin, and fit supernova, cosmic chronometer, and BAO data competitively with ΛCDM.

  7. Measurement of the galaxy-velocity power spectrum of DESI tracers with the kinematic Sunyaev-Zeldovich effect using DESI DR2 and ACT DR6

    astro-ph.CO 2026-04 unverdicted novelty 7.0

    DESI DR2 and ACT DR6 data yield 17σ LRG-velocity, 8.3σ ELG-velocity, and 6.8σ QSO-velocity detections plus a 3.1σ velocity-velocity signal, producing f_NL^loc = 15.9_{-34.4}^{+34.6} from the velocity field.

  8. Milky Way Dynamics Favor Dark Matter over Modified Gravity Models

    astro-ph.GA 2026-05 unverdicted novelty 6.0

    Milky Way radial and vertical dynamics are inconsistent with MOND and STVG but consistent with dark matter halos, disfavoring the former at high significance.

  9. Confronting Color Glass Condensate at next-to-leading order with HERA data

    hep-ph 2026-04 unverdicted novelty 6.0

    A Bayesian global fit at full NLO+NLL accuracy extracts the posterior distribution for the non-perturbative initial condition of the NLO Balitsky-Kovchegov equation from HERA inclusive and charm data.

  10. If at First You Don't Succeed, Trispectrum: I. Estimating the Matter Power Spectrum Covariance with Higher-Order Statistics

    astro-ph.CO 2026-04 unverdicted novelty 6.0

    Estimators from squeezed bispectrum and collapsed trispectrum recover unbiased small-scale matter power spectrum covariance at the percent level using 25 Quijote simulations.

  11. AI-assisted modeling and Bayesian inference of unpolarized quark transverse momentum distributions from Drell-Yan data

    hep-ph 2026-04 unverdicted novelty 6.0

    An AI-assisted Bayesian framework extracts TMD PDFs from global Drell-Yan data using surrogate models for scalable MCMC sampling.

  12. Probing Collapsed Dark Matter Halos with Fast Radio Bursts

    astro-ph.CO 2026-04 unverdicted novelty 6.0

    Core-collapsed SIDM halos produce longer FRB image time delays than CDM halos, enabling future surveys to constrain self-interaction cross sections above roughly 18-40 cm²/g depending on collapse timing.

  13. Posterior Predictive Checks for Gravitational-wave Populations: Limitations and Improvements

    gr-qc 2026-04 unverdicted novelty 6.0

    Maximum-likelihood-based posterior predictive checks detect model misspecification better than event-level versions for uncertain spin tilts, but current detector sensitivity limits their power; the Gaussian Component...

  14. $\boldsymbol{B_c}$ Meson Spectroscopy from Bayesian MCMC: Probing Confinement and State Mixing

    hep-ph 2026-04 unverdicted novelty 6.0

    Bayesian MCMC sampling of Cornell and log-modified Cornell potentials reproduces known B_c states and supplies mass predictions for higher excitations with propagated uncertainties.

  15. Perturbation Dynamics and Structure Formation in Extended Proca-Nuevo Gravity

    gr-qc 2026-04 unverdicted novelty 5.0

    Extended Proca-Nuevo gravity modifies the background expansion via a vector field algebraic constraint but leaves the matter growth equation identical to general relativity.

  16. The January 2010 flare of Mrk421: Insights from a stochastic acceleration model

    astro-ph.HE 2026-04 unverdicted novelty 5.0

    The January 2010 flare of Mrk421 shows spectral variability consistent with stochastic acceleration, including development of a Maxwellian pile-up component in the particle distribution on three nights.

  17. Dynamical dark energy from Kretschmann scalar at low redshifts

    astro-ph.CO 2026-04 unverdicted novelty 5.0

    Replacing the cosmological constant with the Kretschmann scalar yields a dynamical dark energy model that fits supernova and cosmic chronometer data and produces a phantom-crossing equation-of-state parameter w(z) sim...

  18. Directional Tests of the Cosmic Distance Duality Relation using Pantheon+ and BAO

    astro-ph.CO 2026-04 unverdicted novelty 5.0

    No evidence for directional anisotropy in the cosmic distance duality relation is found, yielding a robust 95% upper bound of 0.025 on the dipole amplitude after accounting for survey selection effects.

  19. Probing soft signals of gravitational-wave memory with space-based interferometers

    gr-qc 2026-03 conditional novelty 5.0

    Space-based detectors can measure soft displacement-memory signals from gravitational waves at SNR greater than or equal to 10.

  20. GW250114: testing Hawking's area law and the Kerr nature of black holes

    gr-qc 2025-09 accept novelty 5.0

    GW250114 data confirm the remnant black hole ringdown frequencies lie within 30% of Kerr predictions and that the final horizon area is larger than the sum of the progenitors' areas to high credibility.

  21. On the origin of variability in $\alpha$ Cygni variable $\epsilon$ Ori (HD 37128) using TESS observations and modelling

    astro-ph.SR 2026-05 conditional novelty 4.0

    Linear stability analysis and non-linear hydrodynamical simulations link the stochastic low-frequency variability of ε Ori to strange-mode instabilities that excite finite-amplitude pulsations.

  22. Constraints on Einstein-aether gravity from the precision timing of PSR J1738+0333

    gr-qc 2026-05 unverdicted novelty 4.0

    Precision timing of PSR J1738+0333 from EPTA and NANOGrav data yields the tightest strong-field constraints on Einstein-aether parameters from any single binary pulsar.

  23. No evidence for phantom crossing: local goodness-of-fit improvements do not persist under global Bayesian model comparison

    astro-ph.CO 2026-05 unverdicted novelty 3.0

    Local goodness-of-fit gains for w0wa and phantom crossing vanish under global Bayesian evidence, showing no statistically robust evidence for dynamical dark energy across datasets.

  24. Inferring the properties of a population of compact binaries in presence of selection effects

    astro-ph.IM 2020-07

Reference graph

Works this paper leans on

28 extracted references · 28 canonical work pages · cited by 24 Pith papers · 1 internal anchor

  1. [1]

    201 2, arXiv:1212.1721

    Akeret, J., Seehars, S., Amara, A., Refregier, A., & Csillaghy, A. 201 2, arXiv:1212.1721

  2. [2]

    2012, ApJ, 753, 148

    Bovy, J., Rix, H.-W., Liu, C., et al. 2012, ApJ, 753, 148

  3. [3]

    W., et al

    Bovy, J., Rix, H.-W., Hogg, D. W., et al. 2012, ApJ, 755, 115 – 13 –

  4. [4]

    C., et al

    Bovy, J., Allende Prieto, C., Beers, T. C., et al. 2012, ApJ, 759, 131

  5. [5]

    B., S´ anchez-Janssen, R., Labb´ e, I., et al

    Brammer, G. B., S´ anchez-Janssen, R., Labb´ e, I., et al. 2012, ApJ, 758, L17 Brewer B. J., P´ artay L. B., Cs´ anyi G., 2011, Statistics and Computing, 21, 4, 649-656, arXiv:0912.2380

  6. [6]

    J., Foreman-Mackey, D., & Hogg, D

    Brewer, B. J., Foreman-Mackey, D., & Hogg, D. W. 2012, arXiv:1211.5805

  7. [7]

    M., Rosenfeld, K

    Brown, J. M., Rosenfeld, K. A., Andrews, S. M., Wilner, D. J., & van Dish oeck, E. F. 2012, ApJ, 758, L30

  8. [8]

    S., Gurwell, M

    Bussmann, R. S., Gurwell, M. A., Fu, H., et al. 2012, ApJ, 756, 134

  9. [9]

    Christen, J., A general purpose scale-independent MCMC algorithm , technical report I-07-16, CIMAT, Guanajuato, 2007

  10. [10]

    A., Olofsson, J., Harvey, P

    Cieza, L. A., Olofsson, J., Harvey, P. M., et al. 2013, ApJ, 762, 100

  11. [11]

    Cowles, M. K. & Carlin, B. P., 1996, Journal of the American Statistic al Association, 91, 883 Crossfield, I. J. M., Barman, T., Hansen, B. M. S., Tanaka, I., & Koda ma, T. 2012, ApJ, 760, 140

  12. [12]

    E., Guhathakurta, P., Fardal, M

    Dorman, C. E., Guhathakurta, P., Fardal, M. A., et al. 2012, ApJ, 75 2, 147

  13. [13]

    & Weare, J., 2010, Comm

    Goodman, J. & Weare, J., 2010, Comm. App. Math. Comp. Sci., 5, 65

  14. [14]

    C., Bayesian Logical Data Analysis for the Physical Sciences , Cambridge University Press, 2005

    Gregory, P. C., Bayesian Logical Data Analysis for the Physical Sciences , Cambridge University Press, 2005

  15. [15]

    Data analysis recipes: Fitting a model to data

    Hogg, D. W., Bovy, J., & Lang, D., 2010, arXiv:1008.4686 [astro-ph.IM]

  16. [16]

    W., Weare, J., & Schwab, C

    Hou, F., Goodman, J., Hogg, D. W., Weare, J., & Schwab, C. 2012, ApJ , 745, 198

  17. [17]

    L., Uttley, P., et al

    Huppenkothen, D., Watts, A. L., Uttley, P., et al. 2012, arXiv:1212.1011

  18. [18]

    Lang, D., & Hogg, D. W. 2012, AJ, 144, 46 – 14 –

  19. [19]

    MacKay, D., Information Theory, Inference, and Learning Algorithms , Cambridge University Press, 2003

  20. [20]

    D., Che, X., Zhao, M., et al

    Monnier, J. D., Che, X., Zhao, M., et al. 2012, ApJ, 761, L3

  21. [21]

    Morton, T. D. 2012, ApJ, 761, 6

  22. [22]

    2012, A&A, 542, A90

    Olofsson, J., Juh´ asz, A., Henning, T., et al. 2012, A&A, 542, A90

  23. [23]

    & Gelman, A., 2010, Statistica Sinica, 20, 343–364

    Pasarica, C. & Gelman, A., 2010, Statistica Sinica, 20, 343–364

  24. [24]

    H., Teukolsky, S

    Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P., Numerical Recipes: The Art of Scientific Computing , Cambridge University Press, 2007

  25. [25]

    C., Miller, J

    Reis, R. C., Miller, J. M., Reynolds, M. T., et al. 2013, ApJ, 763, 48 Roˇ skar, R., Debattista, V. P., & Loebman, S. R. 2012, arXiv:1211.1982

  26. [26]

    S., & Fabian, A

    Sanders, J. S., & Fabian, A. C. 2013, MNRAS, 453 van Haasteren, R., Mingarelli, C. M. F., Vecchio, A., & Lassus, A. 2013 , arXiv:1301.6673

  27. [27]

    R., Fouesneau, M., Hogg, D

    Weisz, D. R., Fouesneau, M., Hogg, D. W., et al. 2013, ApJ, 762, 123

  28. [28]

    Widrow, L. M. and Pym, B. and Dubinski, J., 2008, ApJ, 679, 1239This preprint was prepared with the AAS L ATEX macros v5.2. – 15 – A. Installation The easiest way to install emcee is using pip4. Running the command % pip i n s t a l l emcee at the command line of a UNIX-based system will install the package in your Python path. If you would like to instal...