🎲 Markov Chain Monte Carlo: Sampling from Distributions You Can't Compute
Discover how Markov Chain Monte Carlo and the Metropolis-Hastings algorithm let you draw samples from probability distributions you can only evaluate up to an unknown normalizing constant.
The simulation shows a Metropolis-Hastings sampler taking a random walk across a 2D probability landscape, visualizing which proposed moves get accepted or rejected and how the accumulating samples gradually trace out the true shape of the target distribution.
🔬 What It Demonstrates
The simulation shows a Metropolis-Hastings sampler taking a random walk across a 2D probability landscape, visualizing which proposed moves get accepted or rejected and how the accumulating samples gradually trace out the true shape of the target distribution.
🎮 How to Use
Choose a target distribution shape, drag the proposal step-size slider to make jumps larger or smaller, and press play to watch the chain wander, accept or reject moves, and build up a sample histogram that converges toward the target density.
💡 Did You Know?
The Metropolis algorithm was born out of 1950s nuclear weapons research at Los Alamos, and its 1970 generalization by W.K. Hastings extended it to asymmetric proposals; today it remains one of the most cited algorithms in all of statistics and computational science.
Watch a Metropolis-Hastings walker explore a 2D density surface, its trail concentrating in high-probability regions as proposals are accepted or rejected.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install