# Three Samplers, One Posterior: NUTS vs. Emcee vs. Nested Sampling

DevFeed: [Three Samplers, One Posterior: NUTS vs. Emcee vs. Nested Sampling](<https://devfeed.tech/articles/three-samplers-one-posterior-nuts-vs-emcee-vs-nested-sampling-86096.md>)

Original publisher: [Read original article](<https://towardsdatascience.com/three-samplers-one-posterior-nuts-vs-emcee-vs-nested-sampling/>)

Author: Samit Ganguly

Published: 2026-10-13T14:00:00Z

Content type: comparison

Language: en

Sources: [Towards Data Science](<https://devfeed.tech/sources/towards-data-science.md>)

Topics: [Ground truth / benchmark quality](<https://devfeed.tech/topics/ground-truth-benchmark-quality.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [astrophysics](<https://devfeed.tech/tags/astrophysics.md>), [bayesian](<https://devfeed.tech/tags/bayesian.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [data-sciecne](<https://devfeed.tech/tags/data-sciecne.md>), [hamiltonian-monte-carlo](<https://devfeed.tech/tags/hamiltonian-monte-carlo.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [sampling](<https://devfeed.tech/tags/sampling.md>), [statistics](<https://devfeed.tech/tags/statistics.md>)

## AI overview

The article benchmarks NUTS, emcee, and dynesty against exact reference results on three Bayesian sampling problems. NUTS is fastest on smooth problems but gets stuck among modes; emcee can assign confidently incorrect weights to modes; dynesty finds the modes and estimates evidence, though its reported uncertainty can be too small. It recommends choosing a sampler based on the posterior's shape and whether model evidence is needed, and checking convergence against problems with known answers.

## Source excerpt

Benchmarking NumPyro, affine-invariant MCMC, and dynesty against exact ground truth and watching them fail. The post Three Samplers, One Posterior: NUTS vs. Emcee vs. Nested Sampling appeared first on Towards Data Science.