Drawn samples Leapfrog tree path Current chain position
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

No-U-Turn Sampler: Adaptive HMC Trajectory Doubling

The No-U-Turn Sampler (NUTS) is the algorithm quietly doing the heavy lifting inside Stan, PyMC and NumPyro every time a real Bayesian model gets fit. This simulator renders a curved, "banana-shaped" 2D posterior as a 3D probability surface and runs the actual NUTS mechanism on it: each draw resamples momentum, then grows a binary tree of leapfrog integration steps — doubling forward or backward at random — until the no-U-turn criterion (θ⁺−θ⁻)·r ≥ 0 fails at both ends, at which point a sample is chosen automatically from the states visited. Watch the leapfrog tree trace the curving ridge, adjust the step size and maximum tree depth, and run Auto-Sample to see the accumulated draws reconstruct the posterior's true bent shape — exactly the geometry that breaks naive random-walk Metropolis but NUTS handles without any hand-tuned trajectory length.