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

The Sampling Gallery

Interactive Monte Carlo, MCMC, and related sampling algorithms.

Why visualise MCMC?

Build intuition by watching samplers at 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 · read the field notes
Hamiltonian Monte Carlo exploring the banana target

Independent Monte Carlo

Independent draws — exact, weighted or low-discrepancy
RejectionSampling running
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.

ImportanceSampling running
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.

QuasiMonteCarlo running
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
RandomWalkMH running
Random Walk Metropolis

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

AdaptiveMH running
Adaptive Metropolis[1]

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

HamiltonianMC running
Hamiltonian Monte Carlo[2]

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

NUTS running
No-U-Turn Sampler[2]

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

RiemannianHMC running
Riemannian-Manifold HMC[25][26]

Hamiltonian dynamics on a position-dependent metric that adapts to local curvature — it glides through the funnel's neck where fixed-metric HMC stalls.

AAPS running
Apogee-to-Apogee Path Sampler[23]

Cuts the leapfrog path into segments at its apogees and proposes from a random window of them — a simpler, tuning-robust alternative to NUTS.

MALA running
Metropolis-adjusted Langevin[3]

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

SliceSampling running
Slice Sampling[13]

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

EllipticalSlice running
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.

GibbsSampling running
Gibbs Sampling

Updates one coordinate at a time from its exact conditional.

H2MC running
Hessian-Hamiltonian (H2MC)[4]

Uses curvature as well as gradient to shape anisotropic proposals.

ULA running
Unadjusted Langevin[3]

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

SGLD running
Stochastic Gradient Langevin[8][9]

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

FUSE-ULA running
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
EnsembleMCMC running
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.

ParallelTempering running
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
TemperedSMC running
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.

NestedSampling running
Nested Sampling[6]

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

Non-reversible samplers

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

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

BouncyParticle running
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 running
Stein Variational Gradient[5]

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

CoinSVGD running
Coin SVGD[24]

SVGD without a learning rate — every particle coordinate is a coin-betting gambler whose step size emerges from its drift history.

WassersteinParticleDescent running
Wasserstein Particle Descent[27]

The Wasserstein gradient flow of KL, discretized three ways — Blob, GFSD and GFSF entropy forces — with a live kernel Stein discrepancy readout.

SPOS running
Stochastic Particle-Optimization Sampling[28]

SVGD transport plus Langevin noise — the bridge between deterministic particle flow and stochastic exploration.

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

[23] Sherlock, Urbas & Ludkin. The apogee to apogee path sampler. J. Comput. Graph. Statist. (2023).

[24] Sharrock & Nemeth. Coin sampling: gradient-based Bayesian inference without learning rates. ICML (2023).

[25] Girolami & Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. JRSS B (2011).

[26] Betancourt. A general metric for Riemannian manifold Hamiltonian Monte Carlo. GSI (2013).

[27] Liu, Zhuo, Cheng, Zhang, Zhu & Carin. Understanding and accelerating particle-based variational inference. ICML (2019).

[28] Zhang, Zhang, Carin & Chen. Stochastic particle-optimization sampling and the non-asymptotic convergence theory. AISTATS (2020).