Interactive Monte Carlo, MCMC, and related sampling algorithms.
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.
Draws from a simple proposal under an envelope and keeps the lucky ones — exact samples, and a lesson in why MCMC is needed.
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.
Low-discrepancy point sets instead of random draws — evenly stratified space-filling, side by side with plain Monte Carlo.
Blind Gaussian hops, accepted by the density ratio — the simplest sampler there is.
Learns the proposal covariance from its own history as it runs.
Rolls a frictionless particle along gradients to take long, informed leaps; step-size adaptation optional.
HMC that picks its own path length and step size — the self-tuning sampler behind Stan.
Nudges proposals uphill along the gradient, then corrects to stay exact.
Samples uniformly under the density curve by stepping out an interval and shrinking it — no tuning-sensitive accept/reject step.
Slice-samples the angle around an ellipse through the current state and a Gaussian prior draw — rejection-free with no step size to tune.
Updates one coordinate at a time from its exact conditional.
Uses curvature as well as gradient to shape anisotropic proposals.
Gradient plus noise, never rejecting — fast but slightly biased.
Langevin steps from noisy mini-batch gradients; toggle control variates to tame the noise at the mode.
Sets its own step size by optimising over the space of measures.
Walkers propose from each other’s positions — stretch moves are affine-invariant, so correlated ridges come for free. Differential evolution as a second mode.
Replicas at rising temperatures swap states — hot chains cross between modes and hand discoveries to the cold one.
A weighted particle cloud anneals from an easy reference to the target: reweight, resample, rejuvenate. Annealed importance sampling as a no-resampling mode.
Peels the distribution in shells of increasing likelihood, drawing replacements from a constrained region.
[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).