Overview 🔭 | Quick Start 🚀 | Installation 🔧 | Experiments 🧑🔬 | Layout 📂 | Citation 📜 | Resources 📚
This repository contains code for experiments, manuscript, and poster of Sampling From Multiscale Densities with Delayed Rejection Generalized Hamiltonian Monte Carlo, submitted to NeurIPS 2024.
Consider checking out our:
- Paper 📄. Endulge on ArXiv.
- Poster 📊. Admire the bright orange theme.
- Tweet 🐦. I crave your attention.
We propose the delayed rejection generalized Hamiltonian Monte Carlo (DR-G-HMC) algorithm to simultaneously solve two problems in Markov chain Monte Carlo sampling for Bayesian inference:
- Multiscale densities: DR-G-HMC can sample from hierarchical models that exhibit varying curvature (ie multiscale) with dynamic step size selection, enabled by making multiple proposal attempts with decreasing step sizes in a single sampling iteration.
- Inefficient G-HMC: DR-G-HMC replaces rejections with additional proposal attempts, thereby avoiding inefficient backtracking that plagues the generalized HMC (G-HMC) algorithm.
Extensive emperical experiments demonstrate that DR-G-HMC can indeed (1) sample from multiscale densities (unlike NUTS!) and (2) resolve the inefficiencies of G-HMC while (3) maintaining competitiveness with state of the art samplers on non-multiscale densities.
Tip
To use DR-G-HMC for your own hierarchical model with multiscale geometry, use the Bayes-Kit implementation.
Bayes-Kit is a readable, well documented repository for Bayesian inference algorithms in Python. Consider starring the repository ⭐ along with others !
To run experiments from the paper, run the following commands in your favorite virtual environment:
# clone project
git clone https://github.com/gil2rok/drghmc
cd drghmc
# install requirements
pip install -r requirements.txt
Reproduce experiements from the paper by running the following commands:
drghmc/
├── configs/ # experiment configs
├── data/ # store sampler draws
├── doc/ # figures, paper manuscript, & poster
├── posteriors/ # Stan models with data & reference draws
├── scripts/ # scripts to run experiments
├── src/ # sampler implementations
This repository also includes a README.md
, requirements.txt
, LICENSE
, and .gitignore
files. The data
and posteriors
directories also contain their own README.md
files with more information.
@article{turok2024sampling,
title={Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo},
author={Turok, Gilad and Modi, Chirag and Carpenter, Bob},
journal={arXiv preprint arXiv:2406.02741},
year={2024}
}
- Delayed rejection Hamiltonian Monte Carlo for sampling multiscale distributions
- Non-reversibly updating a uniform [0,1] value for Metropolis accept/reject decisions
- A conceptual introduction to Hamiltonian Monte Carlo
- MCMC using Hamiltonian dynamics
- Tuning-free generalized Hamiltonian Monte Carlo
- Slice sampling
Hamiltonian Monte Carlo sampling from a 2-dimensional banana-shaped distribution: