Markov Chain Monte Carlo Visualizer

by Hudson Griffith

Markov Chain Monte Carlo (MCMC) algorithms are a class of methods for sampling from probability distributions. They are especially useful for high-dimensional spaces where direct sampling is difficult. MCMC works by constructing a Markov chain that has the desired distribution as its equilibrium distribution.

This visualization demonstrates the Metropolis-Hastings algorithm, one of the most widely used MCMC methods. It samples from complex multimodal distributions, showing how the algorithm explores the distribution space and gradually builds a representative sample.

Method: Metropolis-Hastings
Visualizing: Markov Chain Transitions
1.00

Controls how far each proposed step can move. Smaller values explore the space more carefully but may get stuck.

100

Configure parameters and press Start to begin the visualization.

How to Read This Visualization

Blue Heatmap: Shows the target probability distribution, with darker blue indicating higher density.

Orange Path: The path the MCMC algorithm has taken, connecting all accepted states.

Red Dots: The current state of the Markov chain.

Green Arrows: Transitions that were accepted by the algorithm.

Red Arrows: Proposed transitions that were rejected.

About This Target Distribution

A mixture of two Gaussian distributions, creating a bimodal landscape with two distinct peaks. This type of complex, multimodal distribution can be challenging to sample from directly, making MCMC methods particularly valuable.

References

This visualization is based on the foundational MCMC papers:Metropolis et al. (1953)andHastings (1970).

Back to Main Page