Skip to main content
Interactive 3D/MCMC Explorer
Target Distribution
Step size σ0.80
Steps
Statistics
Total steps 0
Accept rate -%
Chain length 1
Metropolis-Hastings.
Propose a step. Accept with prob min(1, p(x')/p(x)). Target 20-60% acceptance. Too small = slow mixing. Too large = high rejection.
current   accepted   rejected

MCMC Explorer - Interactive Visualization

Markov Chain Monte Carlo generates samples from a target distribution by constructing a Markov chain whose stationary distribution equals the target. Metropolis-Hastings proposes a new state from a proposal distribution and accepts with probability min(1, p(x')/p(x)). This visualization shows the 2D chain exploring a mixture of Gaussians target, with trace plots showing convergence.

  • Watch Metropolis-Hastings chain step through a 2D target distribution
  • See accepted (indigo dot) vs rejected (gray X) proposals
  • View trace plot: x-coordinate over time should look like white noise at convergence
  • See acceptance rate - too high means timid proposals, too low means wild ones
  • Foundation for Bayesian MCMC, NUTS sampler, and probabilistic programming

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.