← Back to projects

MCMC Visualiser

Live Demo

Compare two MCMC sampling algorithms on a random mixture-of-Gaussians target (reshuffled on every page load). The blue heatmap shows the probability density; a good sampler should spend more time in brighter regions and achieve higher coverage.

0.15

Random Walk Metropolis

acceptance: %
coverage 0%

Adaptive Covariance MCMC

acceptance: %
coverage 0%

Random Walk Metropolis

Proposes a new sample by adding Gaussian noise of fixed size. Simple and general, but sensitive to the step size: too small and it moves slowly, too large and most proposals get rejected.

Adaptive Covariance MCMC

Learns the shape of the target distribution from past samples, adapting its proposal covariance. This lets it explore anisotropic distributions far more efficiently. Notice how coverage grows faster once the adaptation kicks in.

Coverage measures what fraction of the high-probability region (cells within e3.5 of the peak) each chain has visited. It resets on Reset and grows toward 100% as the sampler explores the full distribution.