# dfm/emcee

The Python ensemble sampling toolkit for affine-invariant MCMC

Repository: https://github.com/dfm/emcee
Canonical: https://ross.abutalabs.com/products/emcee
Homepage: https://emcee.readthedocs.io
Language: Python
License: MIT
License Family: permissive
Topics: python, mcmc, mcmc-sampler, probabilistic-data-analysis
Last push: 2026-08-17T21:11:43+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 8, longevity 100
- inputs: {"age_days": 5413, "days_push": 16, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1597, forks 440 (observed 2026-08-28T04:05:09.290710+00:00)

## What it is
emcee is a stable, well-tested Python implementation of the affine-invariant ensemble sampler for Markov chain Monte Carlo (MCMC) proposed by Goodman & Weare (2010). It is widely used for probabilistic data analysis, particularly in astrophysics.

## Use cases
- sample posterior distributions with MCMC in Python
- fit Bayesian models to data
- run ensemble sampling for high-dimensional parameter spaces
- do probabilistic data analysis for astronomy research
- estimate uncertainty on model parameters via MCMC
- replace hand-rolled Metropolis-Hastings samplers

## When to choose
- you need a mature, well-tested MCMC sampler with minimal setup
- your likelihood is expensive and parallelizable across walkers
- you want the affine-invariant ensemble sampler without tuning covariance matrices
- you're doing Bayesian inference in astronomy or the sciences

## When to avoid
- you need gradient-based samplers like Hamiltonian Monte Carlo or NUTS
- you need a full probabilistic programming framework with model syntax
- your posterior is extremely high-dimensional or multimodal where ensemble sampling struggles
- you need GPU-accelerated sampling

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, data-science, math
- domain: data-science, astronomy
- platform: python, cross-platform
- tags: mcmc, ensemble-sampler, bayesian-inference, probabilistic-programming, monte-carlo, algorithms

## Member repositories
- dfm/emcee (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:09.290710+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:53:59.877636+00:00, confidence not recorded.
  - readme: https://github.com/dfm/emcee (fetched 2026-08-28T04:05:09.290710+00:00, sha e689618fce89)
  - registry_pypi: https://pypi.org/pypi/emcee/json (fetched 2026-08-29T11:25:15.562783+00:00, sha 1248faca7be5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
