Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Bayesian›Hierarchical Hamiltonian Monte Carlo
Bayesian methodsBayesian / computational

Hierarchical Hamiltonian Monte Carlo

Hamiltonian Monte Carlo for Hierarchical Models · Also known as: Hierarchical HMC, HMC for hierarchical models, HMC with reparameterization, NUTS for hierarchical Bayesian models

Hierarchical Hamiltonian Monte Carlo (Hierarchical HMC) applies Hamiltonian Monte Carlo sampling to Bayesian hierarchical models, addressing the severe geometric challenges those models pose. By combining non-centered parameterizations with HMC's gradient-driven proposals, it achieves efficient posterior exploration of the multi-level funnel-shaped geometries that standard MCMC methods struggle with.

ScholarGate
  1. Bayesian methods
  2. v1
  3. 2 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Hierarchical Hamiltonian Monte Carlo
Bayesian RegressionHamiltonian Monte CarloHierarchical Bayesian In…Hierarchical Markov Chai…MCMCMultilevel Hamiltonian M…

When to use it

Use Hierarchical HMC when fitting Bayesian hierarchical or multilevel models where standard MCMC (Gibbs, random-walk Metropolis-Hastings) shows poor mixing, high autocorrelation, or divergent transitions — common signs of funnel geometry. It is the recommended sampler in Stan for most hierarchical specifications. Do not use it when the model has discrete latent variables (HMC requires continuous differentiable posteriors), when the posterior is low-dimensional and simple (overhead is unnecessary), or when gradient computation is prohibitively expensive per step.

Strengths & limitations

Strengths
  • Efficiently explores the funnel-shaped posteriors characteristic of hierarchical models, where other MCMC methods fail.
  • Non-centered reparameterization combined with HMC often yields near-independent posterior samples with high effective sample size.
  • Divergent transitions serve as a diagnostic: they signal geometric pathologies before results are trusted.
  • Implemented in Stan and PyMC with automatic differentiation, making it accessible without manual gradient derivation.
  • Scales well to hundreds of parameters compared to random-walk methods.
Limitations
  • Requires a continuous, differentiable log-posterior; incompatible with discrete latent variables.
  • Gradient evaluation cost grows with model complexity and dataset size, making each iteration more expensive than simple MCMC.
  • Tuning step size and path length (or NUTS adaptation) requires a warm-up phase that can be long for challenging geometries.
  • Extremely hierarchically structured models with near-zero variance components may still exhibit problematic funnels even after non-centering.

Frequently asked

What is a divergent transition and why does it matter?

A divergent transition occurs when the leapfrog integrator loses energy conservation due to extreme curvature in the posterior — typically at the neck of a funnel. Divergences indicate that posterior regions are not being sampled correctly, so any reported estimates are biased. The fix is usually a non-centered reparameterization, tighter priors, or a smaller step size.

When should I use non-centered vs. centered parameterization?

Non-centered parameterization decouples the geometry and is preferred when group-level sample sizes are small and the data provide little information about individual groups. Centered parameterization can be better when groups are large and well-observed, because it concentrates the posterior more tightly. In practice, Stan's default or a partially-non-centered approach is recommended when in doubt.

How does Hierarchical HMC differ from standard HMC?

The underlying sampler is the same, but Hierarchical HMC specifically addresses the parameterization and tuning challenges that arise from hierarchical posterior geometry. Key additions are the non-centered reparameterization to flatten funnels, and monitoring divergent transitions as a geometry diagnostic unique to hierarchical settings.

Can I use Hierarchical HMC with discrete parameters?

No. HMC requires continuous, differentiable log-posteriors because it relies on gradients to simulate Hamiltonian dynamics. Discrete latent variables must be marginalized out analytically before applying HMC, or handled with a separate discrete sampler in a Gibbs-within-HMC scheme.

What software implements Hierarchical HMC?

Stan (via its NUTS sampler) is the primary tool and handles non-centered parameterization through model code. PyMC also implements NUTS with similar capabilities. Both provide R-hat, ESS, and divergence diagnostics automatically.

Sources

  1. Betancourt, M. & Girolami, M. (2015). Hamiltonian Monte Carlo for hierarchical models. In S. K. Upadhyay, U. Singh, D. K. Dey & A. Loganathan (Eds.), Current Trends in Bayesian Methodology with Applications (pp. 79-101). CRC Press. link ↗
  2. Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A. & Rubin, D. B. (2013). Bayesian Data Analysis (3rd ed.). CRC Press. ISBN: 978-1439840955

How to cite this page

ScholarGate. (2026, June 3). Hamiltonian Monte Carlo for Hierarchical Models. ScholarGate. https://scholargate.app/en/bayesian/hierarchical-hamiltonian-monte-carlo

Related methods

Bayesian RegressionHamiltonian Monte CarloHierarchical Bayesian InferenceHierarchical Markov Chain Monte CarloMCMC

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • Bayesian RegressionBayesian↔ compare
  • Hamiltonian Monte CarloBayesian↔ compare
  • Hierarchical Bayesian InferenceBayesian↔ compare
  • Hierarchical Markov Chain Monte CarloBayesian↔ compare
  • MCMCBayesian↔ compare
Compare side by side →

Referenced by

Multilevel Hamiltonian Monte Carlo

Similar methods

Hamiltonian Monte CarloHierarchical Markov Chain Monte CarloDynamic Hamiltonian Monte CarloNo-U-Turn SamplerRobust Hamiltonian Monte CarloMultilevel Metropolis-HastingsMultilevel Hamiltonian Monte CarloHamiltonian Monte Carlo with Missing Data

Related reference concepts

Hamiltonian Monte CarloBayesian Computation and MCMCHierarchical Bayesian ModelsMarkov Chain Monte CarloGibbs SamplingHyperpriors and Shrinkage

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Hierarchical Hamiltonian Monte Carlo (Hamiltonian Monte Carlo for Hierarchical Models). Retrieved 2026-07-21 from https://scholargate.app/en/bayesian/hierarchical-hamiltonian-monte-carlo · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Betancourt & Girolami
Year
2015
Type
Bayesian sampling algorithm
DataType
continuous, hierarchically structured
Subfamily
Bayesian / computational
Related methods
Bayesian RegressionHamiltonian Monte CarloHierarchical Bayesian InferenceHierarchical Markov Chain Monte CarloMCMC
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account