Interactive StatisticsA visual guide to MCMC · built from chi-feng/mcmc-demoFree / Open source

The Sampling Gallery

Interactive Monte Carlo, MCMC, and related sampling algorithms.

Why visualise MCMC?

Build intuition by watching samplers work

Markov chain Monte Carlo is a powerful tool for simulating from probability distributions — in particular posterior distributions for Bayesian inference. MCMC algorithms have good theoretical properties and are easily utilised in modern software packages. However, on paper each MCMC algorithm is only a few lines of mathematics; its behaviour is not always obvious. This collection of visualisations across a range of target geometries will let you watch a sampler explore a landscape in real time — where it proposes, what it rejects, how gradients, trajectories and adaptation shape the search. Pick a target, choose an algorithm, tune its parameters and watch it run.

Open Hamiltonian Monte Carlo →or choose from the gallery below
Hamiltonian Monte Carlo animation

Independent Monte Carlo

Independent draws — exact, weighted or low-discrepancy
REJ
Rejection Sampling[14]

Draws from a simple proposal under an envelope and keeps the lucky ones — exact samples, and a lesson in why MCMC is needed.

IS
Importance Sampling[15][21]

Keeps every draw, weighted by p/q; weight degeneracy and the effective sample size are the whole story. SIR resampling and Pareto smoothing (PSIS) as toggles.

QMC
Quasi-Monte Carlo[20]

Low-discrepancy point sets instead of random draws — evenly stratified space-filling, side by side with plain Monte Carlo.

Markov chain Monte Carlo

From random walks to gradient-guided chains
RWMH
Random Walk Metropolis

Blind Gaussian hops, accepted by the density ratio — the simplest sampler there is.

AMH
Adaptive Metropolis[1]

Learns the proposal covariance from its own history as it runs.

HMC
Hamiltonian Monte Carlo[2]

Rolls a frictionless particle along gradients to take long, informed leaps; step-size adaptation optional.

NUTS
No-U-Turn Sampler[2]

HMC that picks its own path length and step size — the self-tuning sampler behind Stan.

MALA
Metropolis-adjusted Langevin[3]

Nudges proposals uphill along the gradient, then corrects to stay exact.

SLICE
Slice Sampling[13]

Samples uniformly under the density curve by stepping out an interval and shrinking it — no tuning-sensitive accept/reject step.

ELL·SLICE
Elliptical Slice Sampling[22]

Slice-samples the angle around an ellipse through the current state and a Gaussian prior draw — rejection-free with no step size to tune.

GIBBS
Gibbs Sampling

Updates one coordinate at a time from its exact conditional.

H2MC
Hessian-Hamiltonian (H2MC)[4]

Uses curvature as well as gradient to shape anisotropic proposals.

ULA
Unadjusted Langevin[3]

Gradient plus noise, never rejecting — fast but slightly biased.

SGLD
Stochastic Gradient Langevin[8][9]

Langevin steps from noisy mini-batch gradients; toggle control variates to tame the noise at the mode.

FUSE
Tuning-free ULA (FUSE)[10]

Sets its own step size by optimising over the space of measures.

Ensemble and multimodal methods

Populations of interacting chains
ENS
Ensemble MCMC[7][18]

Walkers propose from each other’s positions — stretch moves are affine-invariant, so correlated ridges come for free. Differential evolution as a second mode.

PT
Parallel Tempering[16]

Replicas at rising temperatures swap states — hot chains cross between modes and hand discoveries to the cold one.

Sequential and annealed methods

Through a ladder of easier distributions
SMC
Tempered SMC / AIS[17][19]

A weighted particle cloud anneals from an easy reference to the target: reweight, resample, rejuvenate. Annealed importance sampling as a no-resampling mode.

NS
Nested Sampling[6]

Peels the distribution in shells of increasing likelihood, drawing replacements from a constrained region.

Non-reversible samplers

Piecewise-deterministic, rejection-free
ZZ
Zig-Zag Sampler[11]

A particle moves in straight lines, flipping one velocity at a time.

BPS
Bouncy Particle Sampler[12]

Ballistic motion that reflects off the density’s gradient — no rejections.

Deterministic and variational particle methods

Optimisation in the space of measures
SVGD
Stein Variational Gradient[5]

A cloud of particles moves as one, toward the density and apart from itself.

References

[1] Haario, Saksman & Tamminen. An adaptive Metropolis algorithm. Bernoulli (2001).

[2] Hoffman & Gelman. The No-U-Turn Sampler. JMLR (2011).

[3] Roberts & Tweedie. Exponential convergence of Langevin distributions. Bernoulli (1996).

[4] Li et al. Anisotropic Gaussian mutations via Hessian-Hamiltonian dynamics. ACM TOG (2015).

[5] Liu et al. Stein Variational Gradient Descent. NeurIPS (2016).

[6] Buchner. A statistical test for Nested Sampling algorithms. Stat. & Comput. (2014).

[7] ter Braak & Vrugt. Differential Evolution Markov Chain with snooker updater. Stat. & Comput. (2008).

[8] Welling & Teh. Bayesian Learning via Stochastic Gradient Langevin Dynamics. ICML (2011).

[9] Baker et al. Control variates for stochastic gradient MCMC. Stat. & Comput. (2019).

[10] Sharrock & Nemeth. Tuning-Free Sampling via Optimization on the Space of Measures. (2025).

[11] Bierkens, Fearnhead & Roberts. The Zig-Zag process. Ann. Statist. (2019).

[12] Bouchard-Côté, Vollmer & Doucet. The Bouncy Particle Sampler. JASA (2018).

[13] Neal. Slice sampling. Ann. Statist. (2003).

[14] von Neumann. Various techniques used in connection with random digits. (1951).

[15] Kahn & Marshall. Methods of reducing sample size in Monte Carlo computations. (1953).

[16] Geyer. Markov chain Monte Carlo maximum likelihood. (1991).

[17] Del Moral, Doucet & Jasra. Sequential Monte Carlo samplers. JRSS-B (2006).

[18] Goodman & Weare. Ensemble samplers with affine invariance. CAMCoS (2010).

[19] Neal. Annealed importance sampling. Stat. & Comput. (2001).

[20] Niederreiter. Random Number Generation and Quasi-Monte Carlo Methods. SIAM (1992).

[21] Vehtari, Simpson, Gelman, Yao & Gabry. Pareto smoothed importance sampling. JMLR (2024).

[22] Murray, Adams & MacKay. Elliptical slice sampling. AISTATS (2010).