MCMC Sampler Comparator
What you are seeing: three different random-walk algorithms trying to sample from the same probability density . The grey shading on the left is the density itself (darker = higher probability). Each colored trail is one sampler laying down points: it tries to walk in a way that, in the long run, spends time at each in proportion to .
A "good" sampler explores the whole region quickly and decorrelates; a "bad" sampler gets stuck. The right panels are live trace plots of the coordinate of each chain, plus its acceptance rate and effective sample size . Switch the target to the banana or the funnel to see HMC pull ahead; switch to the mixture to see samplers getting trapped in one mode.
shared/js/engine/mcmc-harness.js; ESS via the
initial monotone sequence estimator from
shared/js/invariants/ess.js.WHAT TO TRY
- Switch the target to the banana: a curved ridge that trips up samplers tuned for round Gaussians, so the chains struggle to follow the bend.
- Compare the chains: too small a step gives high acceptance but a slow crawl, too large a step is rejected constantly. The sweet spot sits around 25 percent acceptance.
- Read the effective sample size: a thousand correlated samples are not a thousand independent draws, and that autocorrelation is what really limits how much each chain learns.