Recognition: 2 theorem links
· Lean Theorememcee: The MCMC Hammer
Pith reviewed 2026-05-13 21:55 UTC · model grok-4.3
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.
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
- 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.
Referee Report
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)
- 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
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
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
axioms (1)
- domain assumption The affine-invariant ensemble sampler proposed by Goodman & Weare (2010) produces correct samples from the target distribution when properly implemented.
Lean theorems connected to this paper
-
IndisputableMonolith.Foundation.DAlembert.Inevitabilitybilinear_family_forced unclearOne major advantage of the algorithm is that it requires hand-tuning of only 1 or 2 parameters compared to ∼N² for a traditional algorithm in an N-dimensional parameter space.
Forward citations
Cited by 24 Pith papers
-
Dispersion Measure Distribution of Unlocalized Fast Radio Bursts as a Probe of the Hubble Constant
The DM distribution of unlocalized FRBs yields H0 = 73.8 +14.0/-12.3 km/s/Mpc with 18% uncertainty.
-
VLTI/PIONIER imaging of post-AGB binaries. An INSPIRING hunt for inner rim substructures in circumbinary discs
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.
-
Hidden Monsters with SPHEREx I: A goldmine for heavily reddened quasars at cosmic noon
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.
-
Precision hyperfine spectroscopy of an individual nuclear-spin-9/2
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.
-
Measuring neutrino mass and asymmetry through galaxy pairwise peculiar velocity
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.
-
Cosmologically viable non-polynomial quasi-topological gravity: explicit models, $\Lambda$CDM limit and observational constraints
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.
-
Measurement of the galaxy-velocity power spectrum of DESI tracers with the kinematic Sunyaev-Zeldovich effect using DESI DR2 and ACT DR6
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.
-
Milky Way Dynamics Favor Dark Matter over Modified Gravity Models
Milky Way radial and vertical dynamics are inconsistent with MOND and STVG but consistent with dark matter halos, disfavoring the former at high significance.
-
Confronting Color Glass Condensate at next-to-leading order with HERA data
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.
-
If at First You Don't Succeed, Trispectrum: I. Estimating the Matter Power Spectrum Covariance with Higher-Order Statistics
Estimators from squeezed bispectrum and collapsed trispectrum recover unbiased small-scale matter power spectrum covariance at the percent level using 25 Quijote simulations.
-
AI-assisted modeling and Bayesian inference of unpolarized quark transverse momentum distributions from Drell-Yan data
An AI-assisted Bayesian framework extracts TMD PDFs from global Drell-Yan data using surrogate models for scalable MCMC sampling.
-
Probing Collapsed Dark Matter Halos with Fast Radio Bursts
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.
-
Posterior Predictive Checks for Gravitational-wave Populations: Limitations and Improvements
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...
-
$\boldsymbol{B_c}$ Meson Spectroscopy from Bayesian MCMC: Probing Confinement and State Mixing
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.
-
Perturbation Dynamics and Structure Formation in Extended Proca-Nuevo Gravity
Extended Proca-Nuevo gravity modifies the background expansion via a vector field algebraic constraint but leaves the matter growth equation identical to general relativity.
-
The January 2010 flare of Mrk421: Insights from a stochastic acceleration model
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.
-
Dynamical dark energy from Kretschmann scalar at low redshifts
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...
-
Directional Tests of the Cosmic Distance Duality Relation using Pantheon+ and BAO
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.
-
Probing soft signals of gravitational-wave memory with space-based interferometers
Space-based detectors can measure soft displacement-memory signals from gravitational waves at SNR greater than or equal to 10.
-
GW250114: testing Hawking's area law and the Kerr nature of black holes
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.
-
On the origin of variability in $\alpha$ Cygni variable $\epsilon$ Ori (HD 37128) using TESS observations and modelling
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.
-
Constraints on Einstein-aether gravity from the precision timing of PSR J1738+0333
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.
-
No evidence for phantom crossing: local goodness-of-fit improvements do not persist under global Bayesian model comparison
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.
- Inferring the properties of a population of compact binaries in presence of selection effects
Reference graph
Works this paper leans on
-
[1]
Akeret, J., Seehars, S., Amara, A., Refregier, A., & Csillaghy, A. 201 2, arXiv:1212.1721
- [2]
- [3]
- [4]
-
[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]
J., Foreman-Mackey, D., & Hogg, D
Brewer, B. J., Foreman-Mackey, D., & Hogg, D. W. 2012, arXiv:1211.5805
-
[7]
Brown, J. M., Rosenfeld, K. A., Andrews, S. M., Wilner, D. J., & van Dish oeck, E. F. 2012, ApJ, 758, L30
work page 2012
- [8]
-
[9]
Christen, J., A general purpose scale-independent MCMC algorithm , technical report I-07-16, CIMAT, Guanajuato, 2007
work page 2007
-
[10]
Cieza, L. A., Olofsson, J., Harvey, P. M., et al. 2013, ApJ, 762, 100
work page 2013
-
[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
work page 1996
-
[12]
E., Guhathakurta, P., Fardal, M
Dorman, C. E., Guhathakurta, P., Fardal, M. A., et al. 2012, ApJ, 75 2, 147
work page 2012
-
[13]
Goodman, J. & Weare, J., 2010, Comm. App. Math. Comp. Sci., 5, 65
work page 2010
-
[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
work page 2005
-
[15]
Data analysis recipes: Fitting a model to data
Hogg, D. W., Bovy, J., & Lang, D., 2010, arXiv:1008.4686 [astro-ph.IM]
work page internal anchor Pith review Pith/arXiv arXiv 2010
-
[16]
Hou, F., Goodman, J., Hogg, D. W., Weare, J., & Schwab, C. 2012, ApJ , 745, 198
work page 2012
-
[17]
Huppenkothen, D., Watts, A. L., Uttley, P., et al. 2012, arXiv:1212.1011
-
[18]
Lang, D., & Hogg, D. W. 2012, AJ, 144, 46 – 14 –
work page 2012
-
[19]
MacKay, D., Information Theory, Inference, and Learning Algorithms , Cambridge University Press, 2003
work page 2003
-
[20]
Monnier, J. D., Che, X., Zhao, M., et al. 2012, ApJ, 761, L3
work page 2012
-
[21]
Morton, T. D. 2012, ApJ, 761, 6
work page 2012
-
[22]
Olofsson, J., Juh´ asz, A., Henning, T., et al. 2012, A&A, 542, A90
work page 2012
-
[23]
& Gelman, A., 2010, Statistica Sinica, 20, 343–364
Pasarica, C. & Gelman, A., 2010, Statistica Sinica, 20, 343–364
work page 2010
-
[24]
Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P., Numerical Recipes: The Art of Scientific Computing , Cambridge University Press, 2007
work page 2007
-
[25]
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]
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]
Weisz, D. R., Fouesneau, M., Hogg, D. W., et al. 2013, ApJ, 762, 123
work page 2013
-
[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...
work page 2008
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.