leapfrog trajectoryaccepted samplesproposal acceptedproposal rejected
Couldn't start the 3D scene.

Hamiltonian Monte Carlo: Leapfrog Energy Error, Acceptance and Effective Sample Size

Fitting a Bayesian model means characterising a posterior distribution that almost never has a closed form โ€” so instead you sample from it. This simulator renders that posterior as a real 3D probability-density surface and runs Hamiltonian Monte Carlo on it exactly as Stan or PyMC would: each proposal samples a random momentum, integrates a physical trajectory across the surface with the leapfrog method, and accepts or rejects it by how well total energy was conserved. Watch the chain glide along a correlated ridge far more efficiently than a naive random walk could, tune the step size and trajectory length to see acceptance rate trade off against exploration, and switch to a bimodal target to see where even a gradient-aware sampler can get stuck in one mode.

Made with ๐ŸŸ  Blender ยท Three.js