Brief
Hamiltonian Monte Carlo (HMC) samples from a probability distribution by simulating a particle sliding over the negative log-density, guided by its gradient. Implement HMC with leapfrog integration. Add dual-averaging step-size adaptation (it tunes the step size automatically during warm-up to hit a target acceptance rate) and diagonal and dense mass-matrix warm-up (it learns the scales and correlations of the parameters). Add the multinomial No-U-Turn Sampler (NUTS, which picks the trajectory length automatically by stopping when the path starts to turn back on itself). Get log-density gradients from your I11 autodiff. Validate with SBC rank histograms. SBC (simulation-based calibration) draws true parameters from the prior, simulates data, samples the posterior, and checks that the true value's rank among the draws is uniform. Run on posteriordb posteriors that have reference draws, including Neal's funnel (a shape whose width changes so much that naive samplers fail) and a non-centred eight-schools model.
VICTORY CONDITIONS
- All means and sds within 3 MCSE of reference on 8 posteriors; SBC uniformity passes (chi-square p > 0.01) on 3 models; ESS per gradient >= 0.5x Stan's (Posterior mean/sd error in MCSE units (Monte Carlo standard error: the expected noise from using a finite number of draws) vs posteriordb reference draws; ESS (effective sample size: how many independent draws your correlated draws are worth) per gradient evaluation).
- A public repository with a README that shows your result and how to reproduce it.
Terms in plain words
- HMC (Hamiltonian Monte Carlo)
- An MCMC method that uses gradients to make long, physics-like moves through parameter space, so samples are less correlated.
- NUTS
- A version of HMC that chooses how long each trajectory runs by stopping when it starts to double back.
- SBC (simulation-based calibration)
- A test of a sampler that repeatedly simulates data from known parameters and checks that the posterior draws place those parameters at uniformly random ranks.
- MCSE
- Monte Carlo standard error, the uncertainty in an estimate that comes from having only a finite number of correlated draws.
- ESS (effective sample size)
- The number of independent samples that would give the same precision as your correlated MCMC samples.
- Non-centred parametrisation
- Rewriting a hierarchical model in terms of standardised variables so the sampler does not get stuck in a funnel-shaped posterior.
Why it rates ★★★★☆
Most applied Bayesians never build a correct, SBC-audited NUTS. It is a strong signal for probabilistic-ML roles.