Papers › emcee: The MCMC Hammer

emcee: The MCMC Hammer

16 Feb 2012arXiv:1202.3665links table onlyarchive 2025-07-28

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

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

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² 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.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 48 code samples harvested from 9 repositories linked to this paper: 42 ran (of which 0 constructed an object rather than computing a result; 42 with no instrument failure: 1 honoured, 1 violated, 40 with no contract checked; 0 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: official repository: 10 samples from 1 repository, 10 ran (10 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 38 samples from 8 repositories, 32 ran (32 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

24 repositories listed; official and paper-mentioned ones first.

dfm/emcee officialmentioned in papermentioned on GitHubMITSyntology: 10 samples, 10 ran (0 instrument-failed) · 0 unverified report
abmantz/rgw mentioned on GitHubMITSyntology: not harvested report
aconley/mbb_emcee mentioned on GitHubSyntology: not harvested report
aconley/pofd_affine mentioned on GitHubGPL-3.0Syntology: not harvested report
astromedia/mcmc-analysis mentioned on GitHubMITSyntology: 3 samples, 3 ran (0 instrument-failed) · 0 unverified report
c-matthews/usample mentioned on GitHubGPL-3.0Syntology: not harvested report
dfm/emcee3 mentioned on GitHubMITSyntology: 5 samples, 1 ran (0 instrument-failed) · 4 unverified report
eggplantbren/StretchR mentioned on GitHubGPL-3.0Syntology: not harvested report
hveerten/katu mentioned on GitHubLGPL-3.0Syntology: not harvested report
jadamo/Astro-513-Final-Project mentioned on GitHubSyntology: not harvested report
legolason/javelin-1 mentioned on GitHubGPL-2.0Syntology: not harvested report
mattpitkin/yamm mentioned on GitHubMITSyntology: not harvested report
mcfit/emcee mentioned on GitHubMITSyntology: 7 samples, 6 ran (0 instrument-failed) · 1 unverified report
mindriot101/rust-emcee mentioned on GitHubMITSyntology: 6 samples, 6 ran (0 instrument-failed) · 0 unverified report
nye17/javelin mentioned on GitHubGPL-2.0Syntology: not harvested report
prayush/nsbh_tidal mentioned on GitHubSyntology: not harvested report
rscalzo/pyBoloSN mentioned on GitHubMITSyntology: 7 samples, 6 ran (0 instrument-failed) · 1 unverified report
s-ilic/ECLAIR mentioned on GitHubMITSyntology: 8 samples, 8 ran (0 instrument-failed) · 0 unverified report
utkarshgiri/jaims mentioned on GitHubjaxMITSyntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report
viveikjha/javelin_code mentioned on GitHubGPL-2.0Syntology: not harvested report
wgurecky/bipymc mentioned on GitHubNOASSERTIONSyntology: not harvested report
willvousden/ptemcee mentioned on GitHubSyntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report
zoghbi-a/xspec_emcee mentioned on GitHubMITSyntology: not harvested report
gitlab.com/Noxbru/Katu mentioned on GitHubSyntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

48 samples harvested: 42 ran (of which 0 constructed an object rather than computing a result; 42 with no instrument failure: 1 honoured, 1 violated, 40 with no contract checked; 0 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
1ran · violated contract
40ran
6unverified

Licence: 4 of the 48 samples are pointer only, meaning Syntology does not serve that copy's text. For 1 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 9 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

dfm/emcee official repository 10 samples, 10 ran (0 instrument-failed) · 0 unverified
auto_window src/emcee/autocorr.py ran fingerprinted MIT (permissive) · 5574559b8d4c0099 · report fixture: signature taus:ndarray/1/float, c:float/0/float · returned int64 · level recorded 2026-09-25
deprecated in 25 papers src/emcee/utils.py ran MIT (permissive) · 87b482abfc07970e · report fixture: signature alternate:str/0/str · returned function · level recorded 2026-09-25
function_1d src/emcee/autocorr.py ran fingerprinted MIT (permissive) · 96aebcf0f6d20800 · report fixture: signature x:ndarray/1/float · returned ndarray · level recorded 2026-09-25
get_progress_bar src/emcee/pbar.py ran MIT (permissive) · 36c67203d525ecfe · report fixture: signature display:bool/0/bool, total:int/0/int, kwargs:dict/0/? · returned _NoOpPBar · level recorded 2026-09-25
ndarray_to_list_of_dicts src/emcee/ensemble.py ran MIT (permissive) · f69c32b0d60425d3 · report fixture: signature x:ndarray/2/float, key_map:dict/0/? · returned list · level recorded 2026-09-25
next_pow_two src/emcee/autocorr.py ran fingerprinted MIT (permissive) · 3f0eeafa1475e678 · report fixture: signature n:int/0/int · returned int · level recorded 2026-09-25
sample_ball src/emcee/utils.py ran MIT (permissive) · 4d5bb6b1f4a2b6ec · report fixture: signature p0:ndarray/1/float, std:ndarray/1/float, size:int/0/int · returned ndarray · level recorded 2026-09-25
sample_ellipsoid src/emcee/utils.py ran MIT (permissive) · 6b0c6f7916ecccfe · report fixture: signature p0:ndarray/1/float, covmat:ndarray/2/float, size:int/0/int · returned ndarray · level recorded 2026-09-25
walkers_independent src/emcee/ensemble.py ran fingerprinted MIT (permissive) · 19462bd6634e1504 · report fixture: signature coords:ndarray/2/float · returned bool · level recorded 2026-09-25
walkers_independent_cov src/emcee/ensemble.py ran fingerprinted MIT (permissive) · f53cf8bd70e2f5a2 · report fixture: signature coords:ndarray/2/float · returned bool · level recorded 2026-09-25
astromedia/mcmc-analysis community (archive-listed) 3 samples, 3 ran (0 instrument-failed) · 0 unverified
append_outlier_dist_info utilities_mcmc_analysis.py ran MIT recorded; this copy not marked cleared · pointer only · 70b45fa4c782090f · report fixture: signature param_info:tuple/1/list, data:tuple/1/ndarray · returned tuple · level recorded 2026-09-26
find_outlier_dist_guess utilities_mcmc_analysis.py ran MIT recorded; this copy not marked cleared · pointer only · f81791452b1316be · report fixture: signature data:tuple/1/ndarray · returned list · level recorded 2026-09-26
find_outlier_dist_priors utilities_mcmc_analysis.py ran MIT recorded; this copy not marked cleared · pointer only · 3cef807763c3b110 · report fixture: signature data:tuple/1/ndarray · returned list · level recorded 2026-09-26
dfm/emcee3 community (archive-listed) 5 samples, 1 ran (0 instrument-failed) · 4 unverified
is_model in 24 papers emcee3/model.py ran MIT (permissive) · 83e0386a01c5a548 · report fixture: signature model:callable/0/? · returned bool · level recorded 2026-09-26
default_grad_log_prior_function emcee3/model.py unverified MIT (permissive) · e76836fad9dcb79e · report
default_log_prior_function emcee3/model.py unverified MIT (permissive) · f68e52fd7f0ce48a · report
function in 6 papers emcee3/autocorr.py unverified MIT (permissive) · 4cd7e818c2722e55 · report
integrated_time emcee3/autocorr.py unverified MIT (permissive) · cd91b69a4f3e3775 · report
mcfit/emcee community (archive-listed) 7 samples, 6 ran (0 instrument-failed) · 1 unverified
default_beta_ladder emcee/ptsampler.py ran MIT (permissive) · 42abc12a6b99da3d · report fixture: signature ndim:int/0/int, ntemps:int/0/int, Tmax:NoneType/0/? · returned ndarray · level recorded 2026-09-26
lnprob_gaussian emcee/tests.py ran fingerprinted MIT (permissive) · e5ab97b69f3ee299 · report fixture: signature x:ndarray/1/float, icov:ndarray/2/float · returned float64 · level recorded 2026-09-26
lnprob_gaussian_nan emcee/tests.py ran fingerprinted MIT (permissive) · 41bf464c262d6d85 · report fixture: signature x:ndarray/1/float, icov:ndarray/2/float · returned float64 · level recorded 2026-09-26
log_unit_sphere_volume emcee/tests.py ran fingerprinted MIT (permissive) · 7908b07eda2604b1 · report fixture: signature ndim:int/0/int · returned float64 · level recorded 2026-09-26
sample_ball emcee/utils.py ran MIT (permissive) · b5e99a69e04794a1 · report fixture: signature p0:ndarray/1/float, std:ndarray/1/float, size:int/0/int · returned ndarray · level recorded 2026-09-26
sample_ellipsoid emcee/utils.py ran MIT (permissive) · 9144989af6b02a26 · report fixture: signature p0:ndarray/1/float, covmat:ndarray/2/float, size:int/0/int · returned ndarray · level recorded 2026-09-26
integrated_time emcee/autocorr.py unverified MIT (permissive) · 6449332d84bd4e37 · report
mindriot101/rust-emcee community (archive-listed) 6 samples, 6 ran (0 instrument-failed) · 0 unverified
lnlike python-tests/fitting_a_model_to_data.py ran MIT (permissive) · 5884b56c343520ed · report fixture: signature theta:ndarray/1/float, x:ndarray/1/float, y:ndarray/1/float, yerr:ndarray/1/float · returned float64 · level recorded 2026-09-26
lnlike python-tests/basic.py ran fingerprinted MIT (permissive) · 3f80edeb0c18032f · report fixture: signature params:ndarray/1/float, x:ndarray/1/float, y:ndarray/1/float · returned float64 · level recorded 2026-09-26
lnprior python-tests/fitting_a_model_to_data.py ran MIT (permissive) · 69d5fff3c0e4a5c2 · report fixture: signature theta:tuple/1/float · returned float · level recorded 2026-09-26
lnprior python-tests/basic.py ran MIT (permissive) · 458de16e22e2fba8 · report fixture: signature params:dict/0/? · returned float · level recorded 2026-09-26
lnprob python-tests/fitting_a_model_to_data.py ran fingerprinted MIT (permissive) · 025078eef0025a86 · report fixture: signature theta:ndarray/1/float, x:ndarray/1/float, y:ndarray/1/float, yerr:ndarray/1/float · returned float64 · level recorded 2026-09-26
lnprob python-tests/basic.py ran fingerprinted MIT (permissive) · 2ef998ba72abb670 · report fixture: signature params:ndarray/1/float, x:ndarray/1/float, y:ndarray/1/float · returned float64 · level recorded 2026-09-26
rscalzo/pyBoloSN community (archive-listed) 7 samples, 6 ran (0 instrument-failed) · 1 unverified
krueger12_eta SNPhysics/Priors.py ran MIT (permissive) · 6488f0ccc4df9c0a · report fixture: signature lpc:float/0/float · returned tuple · level recorded 2026-09-26
mi09_Enuc SNPhysics/Priors.py ran fingerprinted MIT (permissive) · 0ea41cd1d9c962a6 · report fixture: signature MFe:float/0/float, MNi:float/0/float, MSi:float/0/float, MCO:float/0/float · returned float · level recorded 2026-09-26
rho_exp run_J99_qint.py ran fingerprinted MIT (permissive) · a3a6c2d96465ec4c · report fixture: signature v:ndarray/1/float · returned ndarray · level recorded 2026-09-26
rho_pow3x3 run_J99_qint.py ran fingerprinted MIT (permissive) · 54cbebc123331570 · report fixture: signature v:Tensor/1/float · returned Tensor · level recorded 2026-09-26
rho_pow7 run_J99_qint.py ran fingerprinted MIT (permissive) · e9d5fe648035b99e · report fixture: signature v:Tensor/1/float · returned Tensor · level recorded 2026-09-26
yl05_bind SNPhysics/Priors.py ran fingerprinted MIT (permissive) · d23887d53edd1531 · report fixture: signature MWD:float/0/float, lpc:float/0/float · returned float64 · level recorded 2026-09-26
SNMCMC_EBMV SNMCMC/SNMCMC_EBMV.py unverified MIT (permissive) · b1a6537510358554 · report
s-ilic/ECLAIR community (archive-listed) 8 samples, 8 ran (0 instrument-failed) · 0 unverified
IAT ECLAIR_plots.py ran MIT (permissive) · 8573d37bba03679c · report fixture: signature samples:ndarray/2/float, c:float/0/float, norm:bool/0/bool · returned float64 · level recorded 2026-09-26
SC ECLAIR_plots.py ran MIT (permissive) · ab9e5bdaa767ed2f · report fixture: signature samples:ndarray/2/float, X:float/0/float · returned list · level recorded 2026-09-26
SG likelihoods/CMB/Planck/PR4/hillipop_EE/tools.py ran MIT (permissive) · 7ffc9e2d1e4092d9 · report fixture: signature l:NoneType/0/?, cl:ndarray/1/float, nsm:int/0/int, lcut:int/0/int · returned ndarray · level recorded 2026-09-26
SQ ECLAIR_plots.py ran MIT (permissive) · edf74ef28a8bc1ac · report fixture: signature samples:ndarray/2/float, X:int/0/int · returned list · level recorded 2026-09-26
convert_to_stdev likelihoods/CMB/Planck/PR4/hillipop_EE/tools.py ran fingerprinted MIT (permissive) · 9982aa84edbe1110 · report fixture: signature sigma:ndarray/2/float · returned ndarray · level recorded 2026-09-26
is_arrval ECLAIR_tools.py ran MIT (permissive) · 2a014fde8fdb2246 · report fixture: signature s:str/0/str · returned list · level recorded 2026-09-26
is_number in 70 papers ECLAIR_tools.py ran · violated contract MIT (permissive) here; the stored copy is pointer only · e18607dae38b30e2 · report fixture: signature s:str/0/str · returned bool · level recorded 2026-09-22
splt ECLAIR_tools.py ran MIT (permissive) · edd64bf4e6addaa8 · report fixture: signature s:str/0/str, sep:NoneType/0/?, maxsplit:int/0/int · returned list · level recorded 2026-09-26
utkarshgiri/jaims community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
initialize_random_walkers jaims/helpers.py ran MIT (permissive) · 9cac3d8648b0ea7a · report fixture: signature nwalkers:int/0/int, loc:ndarray/1/float, upper_bound:ndarray/1/float, lower_bound:ndarray/1/float, scale:float/0/float · returned ndarray · level recorded 2026-09-26
willvousden/ptemcee community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
make_ladder ptemcee/sampler.py ran · honoured contract fingerprinted MIT (permissive) · 7fbbf8658219a198 · report fixture: signature ndim:int/0/int, ntemps:int/0/int, Tmax:float/0/float · returned ndarray · level recorded 2026-09-22

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections