Manuscript Offprint
arXiv:2611.15634Sampling the Funnel: A Comprehensive Survey of Hamiltonian Monte Carlo for Hierarchical Bayesian Inference
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Hierarchical models are central to applied Bayesian statistics, yet the variance structures they depend on can produce posterior geometries that remain difficult to explore even with Hamiltonian Monte Carlo (HMC), a designation now covering a large and increasingly heterogeneous family of algorithms. This survey uses Generalized HMC as an organizing framework to describe the many variants of HMC, their methodological and computational properties, and their empirical consequences. Varying the trajectory length, the degree of momentum refreshment, and the presence of a Metropolis correction recovers several familiar Hamiltonian and Langevin samplers as special cases. Three further, largely independent directions account for much of the remaining literature: modifying the metric, as in Riemannian HMC; modifying the Hamiltonian used by the acceptance test, as in modified or shadow HMC; and modifying the numerical integrator, as in multi-stage splitting schemes. We review these variants alongside the procedures used to tune and diagnose them, with particular attention to the effective sample size, whose standard estimators assume a reversibility that generalized and modified samplers lack, and ignore the importance weights that modified Hamiltonians introduce. We close with the open problems these methods face for hierarchical models, taking joint longitudinal and time-to-event models as the motivating example.
keywords
Bayesian Inference , Geometric Integration , Hamiltonian Monte Carlo , Hierarchical Models , Markov Chain Monte Carlo
The very flexibility and expressiveness that make hierarchical models attractive can, however, make their posterior distributions remarkably difficult to explore computationally, since a variance component linking group parameters to their population distribution may produce regions with profoundly different local scales. The familiar illustration is Neal’s funnel [86], reproduced in Figure 1, in which the conditional spread of the group parameters is proportional to a population scale and therefore contracts sharply near while broadening as increases. A sampler governed by a single proposal scale, integration step size, or preconditioning matrix must then trade numerical stability in the narrow region against meaningful progress in the broader one. More troublingly, a chain confined to the latter may nevertheless appear well mixed in ordinary diagnostics such as trace plots, concealing the bias that results from its failure to traverse the funnel [15].
\theta_{j}$$\log\tauNeck: Small Mouth: Large (a) Centered: \theta_{j}\sim\mathcal{N}(0,\tau^{2})$$\tilde{\theta}_{j}$$\log\tauGlobal (b) Non-Centered:
Fig 1: Geometry of a hierarchical posterior under two standard parameterizations, displayed in the plane spanned by a single group-level parameter and the logarithm of the population scale, with shading and contours marking the envelopes at one, two and three conditional standard deviations. In panel (a) the group parameters are centered upon the population distribution, so that their conditional dispersion is proportional to and the envelopes are exponential in ; the posterior thus contracts into a narrow neck as approaches zero and widens into a broad mouth as grows. Since no single integration step size is at once stable within the neck and efficient within the mouth, a sampler governed by one global scale will either produce divergent trajectories or fail to descend into the neck at all, which is the difficulty isolated by Neal [86] and known since as the “funnel”. In panel (b) the non-centered parameterization renders independent of a priori and restores an approximately isotropic geometry, although it does so only for those groups whose posterior is dominated by the prior. Where the data are informative, the likelihood couples the two coordinates once more, and the funnel reappears in the non-centered coordinates, so that neither parameterization is uniformly preferable [96, 12]. The general case is treated in Section 11.
Hamiltonian Monte Carlo (HMC) [35, 87] addresses random-walk behavior by augmenting the parameters with auxiliary momenta and generating proposals by numerically integrating the Hamiltonian dynamics from a fictitious physical system whose potential energy is the negative log target density. Proposed moves are thus guided by gradients of the log target density rather than by purely random-walk increments, subject to a Metropolis accept/reject correction. The benefit is most evident in high dimensions, where for a -dimensional target with independent and identically distributed (i.i.d.) components, Beskos et al. [10] show that the leapfrog step size must only shrink as to keep the acceptance rate bounded away from zero, compared with for the proposal standard deviation of Random-Walk Metropolis. Betancourt and Girolami [12] give a further detailed account of the benefits and limitations of HMC for hierarchical models.
The designation “Hamiltonian Monte Carlo” has, nevertheless, long ceased to identify a single algorithm. Over the course of three decades, the method has been developed within several research communities whose concerns, motivations, and vocabularies differ considerably: computational statistics has been occupied principally with adaptivity and with the diagnosis of convergence, molecular simulation with energy conservation and the design of integrators, machine learning (ML) with scalability and with learned proposal mechanisms, and numerical analysis with the geometric structure of the underlying flows. A practitioner approaching a hierarchical model is accordingly confronted with generalized, Riemannian, modified, magnetic, relativistic or microcanonical variants of the sampler, among others, with several schemes for the automatic selection of its hyperparameters, with families of splitting integrators of varying order and stability properties, and with a number of mutually inconsistent definitions of well-known diagnostic metrics. The relations among these developments are seldom stated explicitly, and a choice among them is correspondingly difficult to make on principled grounds.
1.1 Aims & Organizing Principles
The present article is intended as a narrative rather than a systematic review and, accordingly, makes no attempt to enumerate the literature exhaustively. Our purpose is instead to offer a connected account of the developments that bear most directly upon hierarchical Bayesian inference, arranging them so that their logical relations become apparent and, hopefully, in a form that is both useful and accessible to practitioners and researchers alike. The exposition is organized around three related ideas, introduced here to orient the discussion that follows.
At the center of this account lies the observation that most Hamiltonian samplers in practical use may be regarded as particular instances of a single generalization of the original method. Generalized Hamiltonian Monte Carlo (GHMC) [61, 64] replaces the complete refreshment of the momentum performed at every iteration of standard HMC with a partial refreshment governed by a parameter , together with a reversal, or flip, of the momentum whenever a proposal is rejected to ensure reversibility. As ranges from one to values approaching zero, the update interpolates between complete refreshment and near-total retention of the previous momentum. Once this choice is considered jointly with the number of integration steps and the presence, or absence, of a Metropolis correction, standard HMC, the Metropolis-Adjusted Langevin algorithm (MALA), second-order Langevin Monte Carlo (L2MC), deterministic molecular dynamics (MDMC), or stochastic Langevin dynamics (SLDMC) all emerge as particular cases. Section 4 and Table 3 revisit these relationships in detail, while Figure 3 uses them to organize a wider taxonomy.
Additionally, beyond the axes of this generalized sampler, much of the remaining literature can be understood in terms of three further directions that are largely independent of one another. Riemannian manifold Hamiltonian Monte Carlo (RMHMC) [45], considered in Section 6, replaces the constant mass matrix with a position-dependent metric , thereby rendering the Hamiltonian non-separable but allowing it to adapt to local variations in curvature such as those encountered in the funnel of Figure 1. Modified, or shadow, Hamiltonian methods [62, 6, 101] begin instead from the fact that a numerical symplectic integrator conserves not the exact Hamiltonian but a nearby modified (or “shadow”) Hamiltonian to much higher order [52]. By sampling from a modified distribution and reweighting the resulting draws back to the original target, they exchange the additional work associated with a truncation of the formal series in for improved energy conservation and higher acceptance rates, as discussed in Section 5. Multi-stage splitting integrators (MSSIs) [17, 102, 84], presented in Section 7, generalize the standard Verlet-Leapfrog scheme to palindromic compositions of momentum kicks and position drifts with tunable coefficients, again trading additional gradient evaluations for more accurate energy conservation. Since these three modifications are largely orthogonal and may be combined, one may, for example, construct a modified-Hamiltonian sampler with partial momentum refreshment and an adaptively tuned three-stage integrator, with each choice carrying its own consequences for the geometry of the target, the stability of the integration, and the efficiency of the resulting sampler.
The final organizing concern is tuning and diagnosis, a subject often relegated to a brief aside in the algorithmic literature despite its central importance in practice. The performance of a Hamiltonian sampler is governed by the step size , the number of integration steps , the momentum noise parameter , and the mass matrix (or, more generally, the metric ), yet the optimal values best suited to these quantities depend upon a target geometry that is unknown a priori. Section 8 thus contrasts two particularly successful families of schemes that have developed around this problem of parameter selection and tuning: methods descended from the No-U-Turn sampler (NUTS) [55, 56, 18], which adapt online from the observed behavior of the chain, and those descended from the adaptive integration approach (AIA) [84, 5], which fit a tractable surrogate during a burn-in phase and derive their parameters from a closed-form analysis. Section 9 then turns to the assessment of convergence, exploration, and computational efficiency, paying particular attention to the effective sample size (ESS) metric, whose meaning and relation to sampler efficiency are considerably more subtle and context-dependent than its routine use might suggest. We consequently distinguish among the assumptions, limitations, and appropriate uses of the available estimators: Geyer’s initial sequence estimators [44], for example, provide the default ESS in most widely used implementations but rely upon reversibility, a condition not satisfied by generalized and modified Hamiltonian methods, whereas estimators developed for importance sampling [66, 37, 79] account for weight degeneracy while disregarding autocorrelation entirely. Modified HMC combines simultaneously autocorrelation, irreversibility, and importance reweighting, and no standard estimator presently addresses all three at once.
1.2 Scope
Our motivating application, treated in Section 11, is the joint modeling of longitudinal and time-to-event data [106]. Such models include subject-specific random effects beneath a variance hierarchy and can therefore exhibit funnel-like geometries. Moreover, their survival likelihoods commonly require numerical quadrature for the cumulative hazard, making gradients substantially more expensive to compute than in a comparable generalized linear mixed models. In this setting, posterior geometry and the number of gradients per effectively independent draw are both important. Higher-order integrators, modified Hamiltonians, and partial momentum refreshment are relevant insofar as they improve that trade-off.
We restrict attention throughout to continuous parameter spaces and to samplers that are, at least in intent, asymptotically exact whether directly or after reweighting. Variational methods, together with the extensive literature on unadjusted stochastic gradient dynamics, appear only where they bear directly upon the samplers under discussion. Extensions to discrete parameters are surveyed briefly in Section 6 and revisited among the open problems collected in Section 13.
1.3 Notation & Outline
We write for the model parameters, which play the role of “position” coordinates in the simulated system, and for the auxiliary momenta; denotes the Gaussian noise vector employed in partial momentum updates, and a point of the -dimensional phase space. The target density is , the potential energy up to an additive constant, the kinetic energy with mass matrix , and the Hamiltonian . Numerical integrators are denoted by , where is the step size and the number of integration steps, and are constructed from position drifts and momentum kicks . Finally, denotes a truncated modified Hamiltonian, the extended Hamiltonian associated with a partial momentum update (PMU), the momentum noise parameter, the number of Monte Carlo samples, and the dimension of the problem, with the notation as a whole summarized in Table 1 for reference. The notation is chosen to be consistent with the literature, but also to be as uniform as possible across the several communities that have contributed to the development of Hamiltonian Monte Carlo.
The remainder of the article is organized as follows. Section 2 reviews Bayesian inference, Markov Chain Monte Carlo, and the pathologies specific to hierarchical problems, after which Section 3 develops HMC and its geometric foundations, and Section 4 introduces GHMC as the unifying framework. Modified Hamiltonians and importance-reweighted sampling are then treated in Section 5, with Riemannian, non-separable, and alternative dynamics following in Section 6. Numerical integration, hyperparameter tuning, and sampling diagnostics, including the effective sample size, occupy Sections 7, 8, and 9, respectively. Section 10 asks how these cost accountings change once the samplers are placed upon parallel hardware and distinguishes the several meanings attached to the term “parallelism”. We return to hierarchical models, and to joint models in particular, in Section 11. The available software is surveyed in Section 12, and Section 13 collects open problems and directions for future work.
Table 1: Notation used throughout the survey.
| Symbol | Meaning |
|---|---|
| Model parameters (position coordinates) | |
| Auxiliary momenta | |
| Gaussian noise vector (partial momentum update) | |
| Phase-space point | |
| Target density (posterior) | |
| Potential energy of the fictitious system | |
| Kinetic energy of the fictitious system | |
| Hamiltonian, | |
| -th order truncated modified Hamiltonian | |
| Extended Hamiltonian for the PMU | |
| Mass matrix; for a position-dependent metric | |
| , | Integration step size; Dimensionless step size |
| Number of integration steps (i.e., trajectory length) | |
| Momentum noise or refreshment parameter | |
| Number of stages of a splitting integrator | |
| Numerical integrator | |
| , | Position drift and momentum kick flows |
| , | Importance weights; Normalized importance weights |
| Number of Monte Carlo samples | |
| Dimension of the problem |
2 Background
2.1 Bayesian Inference & Monte Carlo Integration
In contrast to the frequentist approach, in which the parameters of a model are regarded as fixed, but unknown constants and inferential procedures are justified by their behavior under hypothetical repetitions of the experiment, Bayesian inference regards as random variables and the observed data as fixed, so that uncertainty about the parameters is expressed directly in probabilistic terms and every inferential statement derives from the posterior distribution obtained by conditioning the prior on the data through Bayes’ theorem,
where is the prior, the likelihood, and the marginal likelihood, or evidence, which acts as a normalizing constant and is typically not available in closed form [42, 107]. Moreover, the posterior density is seldom the ultimate object of interest, with quantities of interest for inference being more often expectations of functions with respect to that posterior, of the form
a class of integrals broad enough to encompass posterior means and covariances (taking and respectively), masses of credible regions (taking to be an indicator function), or posterior predictive distributions of the form for prediction and model checking. The integrals in (2) are typically high-dimensional, with ranging from a few to several thousand in realistic applications, and they are often sharply concentrated in small regions of the parameter space, so that the integrand is negligible over most of the domain of integration.
Thus, the standard approach to this problem is through Monte Carlo (MC) integration, whereby the integral is replaced by an average of the integrand evaluated at draws from the posterior,
where, provided that such draws are available, the estimator in (3) is unbiased and has variance , independently of once the variance of has been fixed, which makes the procedure attractive even in high-dimensional settings [95]. The difficulty, of course, is that the posterior is generally known only up to a normalizing constant , and consequently cannot usually be sampled from directly.
2.2 Markov Chain Monte Carlo (MCMC)
Markov Chain Monte Carlo (MCMC) methods address this lack of direct sampling by constructing a Markov Chain whose stationary distribution is the target , so that after an initial burn-in period the states of the chain may be treated as draws from the posterior, albeit correlated ones. The Metropolis–Hastings schema [81, 53] then proposes a candidate state from a proposal distribution and accepts it with probability
which leaves invariant and involves the target only through unnormalized densities. Under mild irreducibility and aperiodicity conditions, the resulting chain is ergodic and the estimator (3) remains consistent when the are states of the chain rather than i.i.d. draws [124]. Nevertheless, the resulting consecutive states are correlated and the variance of the estimator is consequently inflated so the effective number of independent draws is smaller than , the subject of Section 9.
This loss of effective sample size makes the efficiency of the sampler, and hence the choice of proposal distribution , especially important, as is already apparent for Random-Walk Metropolis–Hastings (RWMH), which takes . In high dimension, probability mass becomes concentrated in a thin shell of the parameter space known as the typical set [16], so that an isotropic proposal large enough to move appreciably will generally leave this shell and be rejected, whereas one small enough to obtain a reasonable acceptance probability advances each coordinate by only a short distance. Indeed, under the product-target asymptotics of Roberts and Rosenthal [109], the proposal standard deviation must scale as , with an optimal acceptance rate of , and the chain consequently requires iterations to travel an distance in each coordinate.
The poor high-dimensional scaling of random-walk proposals motivates the introduction of gradient information, as in the Metropolis-Adjusted Langevin algorithm (MALA) [114, 108], whose proposal discretizes a Langevin diffusion that is -invariant and, under suitable conditions, geometrically ergodic [110]. MALA biases each proposal along and achieves an Euler step size , equivalently, a proposal noise standard deviation , at an optimal acceptance rate of . HMC goes further by composing many gradient evaluations into a single consistent trajectory and, at an optimal acceptance rate of approximately , achieves [10]. Table 2 collects these two regimes together with the random-walk baseline.
Table 2: Optimal scaling of Metropolis-type samplers under i.i.d. asymptotics. “Step size” is the proposal standard deviation for RWMH, the Euler step for MALA, and the leapfrog step for HMC. Work counts the cost of moving an distance in each coordinate, charging for each target or gradient evaluation.
| Sampler | Step Size | Optimal AR | Work |
|---|---|---|---|
| RWMH [109] | |||
| MALA [108] | |||
| HMC [10] |
2.3 Hierarchical Models & Associated Pathologies
In its simplest and most widely studied form, a hierarchical model assigns a parameter to each of groups and ties the resulting vector together through a common population distribution, whose parameters are themselves treated as unknown hyperparameters and assigned a prior,
in which denotes the observations associated with the -th group, with extensions to multivariate settings and to further levels being straightforward. In the most common case, the population distribution is a location-scale family, typically with , so that the scale controls the degree to which the groups are pooled toward the common mean , we use this Gaussian case as a running example below. The posterior over the full vector , of dimension in the Gaussian case, exhibits three distinct features that stress samplers and render the scaling results of Table 2 relevant even for moderate values of the number of groups and the dimension of the hyperparameters .
Varying curvature. Conditionally on , the group parameters are dispersed on a scale proportional to . When the posterior supports a wide range of values for this hyperparameter, as can happen with few groups or weakly informative ones, their conditional widths vary accordingly. The joint density can then assume the funnel shape of Figure 1, with a narrow, high-curvature region at small , and a broader region at large . In terms of the potential energy , the local Hessian can consequently be ill conditioned, i.e., have a large condition number , and the resulting geometry can be difficult to explore. This feature motivates the Riemannian methods of Section 6 and the reparameterizations of Section 11.
Strong global correlation. The second feature is a strong global dependence that persists well away from the neck of the funnel. The population scale and the group parameters are strongly dependent, since the spread of the about determines the plausible values of , and the are mutually dependent through their common parent, with the consequence that samplers updating the coordinates in separate blocks are severely handicapped. In the Gaussian case with group-level estimates , a Gibbs sampler alternating between the full conditionals and can take very small steps when each group carries little information. Given , the scale is determined to within a relative error of order , whereas its posterior spread is larger by a factor of roughly , where , so that the number of iterations needed to traverse the posterior of is of order [96]. The slow mixing of the variance components persists in deeper hierarchies [131]. Samplers that update the entire parameter vector simultaneously, among them HMC, avoid this particular difficulty, although they remain fully subject to the first.
Growing dimensionality. As more data are collected, the dimension grows with the data, i.e., the number of groups and the number of parameters per group can increase with the sample size, so that the dimension of the target distribution is not fixed. Each additional group contributes parameters, so a joint model for subjects with random effects per subject has latent parameters in addition to its fixed effects. As the dimension increases, samplers with random-walk behavior in even a subset of the coordinates can degrade sharply. The scaling results in Table 2 are therefore practically relevant to hierarchical models.
In order to address these pathologies, two broad families of complementary strategies have been developed. The first modifies the algorithm, whether by exploiting gradient information, by adapting the metric to the local geometry of the target, or by improving the numerical integrator, and occupies Sections 3 through 8. The second modifies the coordinates in which the model is expressed, replacing the centered specification of (5) by a non-centered parameterization
in which is a priori independent of the hyperparameters and the funnel is consequently absent from the prior, as illustrated in the right panel of Figure 1. Neither parameterization dominates the other in general: as Betancourt and Girolami [12] established, the preferable choice depends upon whether the prior or the likelihood dominates the posterior of each individual group, and in models where that balance differs from one group to another neither specification is adequate on its own. Section 11 returns to this question in detail.
3 Hamiltonian Monte Carlo (HMC)
3.1 The Augmented Target Distribution
Hamiltonian Monte Carlo [35, 87] circumvents the random-walk behavior described in Section 2 by augmenting the parameters with auxiliary momenta and using Hamiltonian trajectories to construct distant proposals informed by the geometry of the target distribution. The construction borrows from statistical mechanics the notion of a canonical distribution: given an energy function defined over the states of a physical system, the associated canonical distribution at temperature has density , so that, read in the opposite direction, any density of interest may be realized as a canonical distribution at by taking up to an additive constant [87]. Applying this correspondence to an augmented state consisting of the parameters , which now play the role of a position coordinate, together with auxiliary fictitious momenta assigned a density independent of , yields the joint target
whose energy function is the Hamiltonian
where is the potential energy, the kinetic energy, and a symmetric positive definite mass matrix of the system. Choosing renders quadratic and the Hamiltonian separable, in the sense that depends on alone and on alone. Separability is not theoretically demanded but allows the use of the computationally efficient explicit symplectic integrators of Section 7, and relinquishing it as the Riemannian methods of Section 6, carries a substantial computational cost.
Because the joint density in (7) factors into a product of the marginal and the conditional , the position and momentum are independent under the augmented target and the marginal in is exactly the posterior : any chain that is invariant for therefore yields, upon discarding the momenta, samples from the distribution of interest. Although the momenta are introduced purely as auxiliary variables, the whole advantage of HMC stems from exploiting the geometry of the resulting augmented target in order to propose moves in that remain coherent over comparatively long distances, thereby producing a Markov Chain far less diffusive than that obtained from conventional random-walk Metropolis–Hastings. To see how this advantage arises, we first describe the dynamics underlying those proposals and then turn to the manner in which they may be embedded within a valid MCMC algorithm.
3.2 Hamiltonian Dynamics & Its Properties
In terms of the dynamics of the system, the augmented state evolves in a fictitious time according to Hamilton’s equations,
which may be written compactly as with the canonical symplectic matrix. Writing for the exact flow map that advances the state over time, four properties make an ideal proposal mechanism for MCMC [87, 72, 11].
Reversibility. The map is one-to-one and possesses an inverse obtained by negating the time derivatives in (9). When the Hamiltonian is separable and the kinetic energy is even in the momentum, so that as holds for the quadratic form adopted here, the inverse admits the more convenient representation
so that reversing the dynamics amounts to negating the momentum, evolving forward for the same interval, and negating the momentum once more. Reversibility allows a Metropolis proposal built from to be symmetric, and hence the acceptance probability to reduce to a ratio of target densities alone.
Conservation of the Hamiltonian. Along any solution of (9) the energy is an invariant of the motion, since
As the augmented density in (7) is a monotone function of alone, an exactly simulated trajectory moves within a hypersurface of constant probability density, and a proposal generated in this manner would be accepted with probability one however far it travelled. In practice, the dynamics can only be integrated approximately, with the resulting energy error responsible for rejections.
Volume Preservation. The vector field defined by (9) is divergence free, i.e.,
from which it follows that carries any region of phase space onto a region of equal volume, a result known as Liouville’s theorem, and equivalently, that the Jacobian determinant of has unit absolute value. The significance for MCMC is that the Metropolis–Hastings ratio in (4) then requires no Jacobian correction, so that a deterministic and highly non-local proposal may be employed without evaluating a determinant that would in general be intractable.
Symplecticness. A stronger statement may be made by writing for the Jacobian matrix of regarded as a map of , in terms of which the flow satisfies the symplecticness condition
from which volume preservation follows immediately, since (13) forces . In practice, this symplecticness is strictly stronger than volume preservation, and HMC integrators are constructed to preserve it.
The observation on which the whole method depends is that reversibility, volume preservation and symplecticness can be maintained exactly by a suitable discretization of (9), even though conservation of the Hamiltonian cannot [87, 52]. The two halves of this asymmetry are pursued separately in the sections that follow, the preservation of structure in Section 7 and the failure of exact energy conservation in Section 5.
Remark 3.1.
In terms of the choice of momentum distribution, any density yields a valid algorithm, but the Gaussian is very nearly universal for two reasons. It renders the first of Hamilton’s equations linear, , giving a drift that can be solved exactly, and it makes the mass matrix act as a linear preconditioner, since taking equal to the inverse posterior covariance transforms the target to approximate isotropy, which is why practical implementations estimate a diagonal or dense during warm-up. Other momentum distributions can be useful in specific settings, including Laplace momenta for discontinuous targets [92] and relativistic kinetic energies that bound the particle speed and limit the effect of large gradients [75]. Both are discussed in Section 6.
3.3 The HMC Algorithm
Since Hamilton’s equations admit no closed-form solution for a general potential, the flow must be approximated by a numerical integrator applied for steps of size , after which a complete HMC iteration may be understood as the composition of two updates that each leave the augmented target (7) invariant [87]. In the first, the momentum is drawn afresh from independently of the current position and, because remains unchanged while is drawn from its correct conditional distribution, which by independence coincides with its marginal, invariance is immediate. In the second, a Metropolis update is performed in which the proposal is obtained by integrating the dynamics from the current state and negating the resulting momentum, and is accepted with probability
The negation is what makes the proposal symmetric and hence (14) valid, although implementations routinely omit it: leaves the acceptance probability unchanged, and the momentum is discarded at the start of the next iteration in any case. In Generalized HMC, treated in Section 4, the momentum persists from one iteration to the next and this negation acquires a genuinely consequential role.
Moreover, provided that the integrator is volume preserving and time reversible, the Metropolis correction leaves the augmented target invariant for any step size [87], so numerical error affects the acceptance rate rather than changing in any way the stationary distribution of the chain. Symplectic integrators are preferred because, in addition to satisfying these structural requirements, they control the energy error over long trajectories. The complete procedure is given in Algorithm 1.
Algorithm 1 Hamiltonian Monte Carlo (HMC)
1: Input:
| : | Number of Monte Carlo samples |
|---|---|
| : | Step size |
| : | Number of integration steps (trajectory length) |
| : | Mass matrix |
| : | Symplectic, reversible numerical integrator |
2: Output:
| : | Samples from the target distribution |
|---|
3: Initialize
4: for to do
5:
6: Sample momentum
7: // Generate proposal by simulating Hamiltonian dynamics:
8:
9:
10: // Metropolis–Hastings test:
11:
12: Sample
13: if then
14: // Proposal accepted
15: else
16: // Proposal rejected
17: end if
18: Discard momentum
19: end for
The sampler has three tuning parameters. The step size governs the energy error, with excessively large values producing large and low acceptance rates, or, beyond the stability limit, divergent trajectories; while excessively small values spend costly gradient evaluations on negligible movement. The trajectory length , meanwhile, determines how far a proposal travels, so that short trajectories leave successive samples strongly correlated whereas overly long trajectories may double back towards their starting neighbourhood. For a near-Gaussian target, the total integration time is often chosen near half the period of the slowest mode, although certain integration times remain pathological because of the resonances discussed in Section 7. The mass matrix , finally, determines the relative time scales of the coordinates, bringing their characteristic frequencies closer together when it is well chosen and leaving them widely separated when it is not. Sections 7 and 8 are devoted to the selection of these quantities, whose optimal values depend upon the local geometry and may therefore vary substantially across the posterior of a hierarchical model, an observation that motivates much of the discussion to follow.
3.4 Mechanisms and Limitations
Rather than attempting to locate the typical set by means of a random walk, HMC uses gradients of the log target to construct a trajectory that is likely to follow it [16], with each trajectory remaining close to a level set of that will ordinarily intersect the typical set of as a newly drawn momentum contributes kinetic energy of order . The numerical trajectory explores one such level set, while the subsequent refreshment of the momentum changes the total energy and thereby allows the chain to pass between different level sets. Without that refreshment, would remain nearly constant and, since is non-negative, could never rise above the value allowed by the initial energy, leaving parts of the posterior inaccessible [87]. The energy Bayesian fraction of missing information introduced in Section 9 is intended precisely to assess whether this mechanism produces sufficient movement between energy levels [15].
Furthermore, dimension enters the acceptance rate through the energy difference , for which a target proportional to satisfies and, by Jensen’s inequality, [87]. For a product target, this difference is a sum of contributions from the individual components and the step size must consequently decrease with if the acceptance rate is to remain non-vanishing, leading to the rates summarized in Table 2 and, for HMC in particular, to .
The same construction also makes clear where standard HMC remains limited: because the momentum is refreshed completely after every iteration, the direction established by a successful trajectory is immediately discarded, motivating the partial refreshment examined in Section 4. Moreover, because an order- integrator accumulates an error in of over a fixed integration time, reducing improves acceptance only by trading that improvement with additional gradient evaluations, a trade-off reconsidered in Sections 7 and 5. Finally, because a single mass matrix and step size are used throughout the parameter space, the method cannot adjust directly to a funnel whose stable step size differs by orders of magnitude between its neck and mouth. The last of these limitations leads in turn to position-dependent metrics in Section 6, local step size adaptation in Section 8, and the reparameterization in Section 11.
4 Generalized Hamiltonian Monte Carlo (GHMC)
4.1 Partial Momentum Refreshment
The complete refreshment of the momentum performed in Algorithm 1 is a simple and effective way to ensure that the chain does not become trapped in a single direction of travel, but it is also wasteful and discards useful trajectory information from one iteration to the next. A trajectory that has just travelled productively in some direction is followed by a momentum drawn without any reference to it, so that the direction is forgotten and the chain retains a residual random-walk. Yet, the momentum cannot simply be left unchanged, since its marginal must remain for the chain to be reversible and have the correct invariant distribution, and it is the refreshment that renders the chain ergodic across the energy level sets of Section 3. Nothing, however, requires this refreshment to be complete.
Generalized Hamiltonian Monte Carlo (GHMC), introduced by Horowitz [61] and developed by Kennedy and Pendleton [64], uses a partial momentum update (PMU) to retain some of the previous momentum across iterations. A noise vector is drawn and the pair is rotated through an angle determined by a parameter ,
Because the rotation in (15) preserves volume and leaves the product invariant, has the correct marginal distribution whenever does, while retaining a correlation of with the previous momentum. Small values of therefore preserve the direction of travel over several iterations, with a complete refreshment at , reducing GHMC to standard HMC, whereas as the previous momentum is retained almost entirely.
When the momentum persists, a rejected proposal cannot simply leave the joint state unchanged without violating reversibility and the invariance of . GHMC therefore applies instead the momentum flip before performing the PMU, reversing the direction in which the chain was travelling. The chain obtained in this way is irreversible by construction, a property that can lower the asymptotic variance relative to a reversible chain with the same invariant distribution [94, 36], but also places it outside the assumptions of standard effective sample size estimators, as discussed in Section 9. The complete procedure is stated in Algorithm 2 and represented schematically in Figure 2.
Algorithm 2 Generalized Hamiltonian Monte Carlo (GHMC)
1: Input:
| : | Number of Monte Carlo samples |
|---|---|
| : | Step size |
| : | Number of integration steps (trajectory length) |
| : | Mass matrix |
| : | Momentum noise parameter, |
| : | Symplectic, reversible numerical integrator |
2: Output:
| : | Samples from the target distribution |
|---|
3: Initialize
4: for to do
5:
6: // Partial momentum update:
7: Sample
8:
9:
10: // Generate proposal by simulating Hamiltonian dynamics:
11:
12:
13: // Metropolis–Hastings test:
14:
15: Sample
16: if then
17: // Proposal accepted
18: else
19: // Rejected: momentum flip
20: end if
21: end for
(1) Partial Momentum Update (PMU)(2) Dynamics Integration(3) Metropolis–Hastings Test(4a) Accept(4b) Reject & Flip(\boldsymbol{\theta}_{n},\mathbf{p}_{n})=(\boldsymbol{\theta},-\mathbf{p}^{*})$$u<\alpha$$u\geq\alpha$$\mathbf{p}_{n} Persists Into the Next Iteration’s Partial Update( Collapses to a Full Momentum Refresh, Recovering HMC)
Fig 2: One GHMC iteration. The momentum is partially refreshed, the resulting state is propagated for integration steps, and the proposal is accepted or rejected by the Metropolis test. On rejection, the position is retained and the momentum is reversed. The dashed paths show that the resulting momentum is used in the next partial update. Setting gives the full momentum refresh of standard HMC.
4.2 Special Cases of GHMC
Several familiar Hamiltonian and Langevin samplers may be recovered simply by fixing the trajectory length , the refreshment parameter , and the presence or absence of a Metropolis correction step, with the most relevant choices collected in Table 3.
Table 3: Special cases of Generalized HMC. Fixing the trajectory length , the momentum refreshment parameter , and the presence of a Metropolis test recovers each named algorithm. For SLDMC, denotes the friction coefficient and the discretization step.
Method Reference Metropolis test GHMC [61, 64] arbitrary arbitrary yes HMC [35, 87] arbitrary yes MALA [114, 108] yes L2MC [61] arbitrary yes MDMC – arbitrary no SLDMC [7] arbitrary no
Setting makes and hence recovers standard HMC through complete momentum refreshment. If one additionally takes , the resulting method is MALA, whose Euler-step scaling was reported in Table 2, whereas retaining but allowing produces second-order Langevin Monte Carlo (L2MC), in which momentum persists across iterations. If the Metropolis correction is instead removed, these choices lead to unadjusted dynamics such as deterministic molecular dynamics when and stochastic Langevin dynamics for small , whose stationary distributions are generally biased relative to , often by order for an order- integrator under suitable regularity conditions. The microcanonical samplers discussed in Section 6 belong to this latter group. Figure 3 places these special cases on a single taxonomy together with the three orthogonal directions of extension introduced in Section 1.
Specializations: Fixing Generalized HMC PMU Momentum Flip Upon Rejection HMCMALAL2MCMDMC, No MHSLDMC, No MHExtensions: Additional Modifications to GHMC The Metric RMHMC; SoftAbs; Lagrangian MC; Magnetic and Relativistic HMC Non-Separable ; Implicit Integrators The Conserved Density SHMC; GSHMC; MMHMC Near-Unit AR; Importance Reweighting The Integrator Selection of Verlet; -Stage MSSIs; BCSS, Minimum-Error; s-AIAk Energy Error vs. Gradients per Step
Fig 3: A taxonomy of Hamiltonian samplers organized around Generalized HMC. Left: fixing the trajectory length , the momentum refreshment parameter , and whether a Metropolis test is applied recovers standard HMC, MALA, L2MC, molecular dynamics and stochastic Langevin dynamics as special cases of a single algorithm (Table 3). Methods toward the right of the row drop the Metropolis correction and generally have a stationary bias of order under suitable regularity conditions for an order- integrator, whereas those to the left remain exactly asymptotically correct. Right: the remaining literature is obtained by replacing one of three ingredients, namely the metric, the density that the integrator conserves, or the integrator itself: RMHMC [45], SoftAbs [13], Lagrangian Monte Carlo [68], magnetic [126] and relativistic [75] HMC for the metric; SHMC [62], GSHMC [6] and MMHMC [101] for the conserved density; multi-stage splitting integrators [17] and s-AIA [84] for the integrator. Each axis composes freely with any sampler on the left.
4.3 Choosing &
The choices of and are coupled, and the optimal values depend upon the target distribution and the integrator. A small preserves the direction of travel across iterations, which is beneficial only if the trajectories being chained together are in fact accepted, since a rejection flips the momentum and undoes the progress accumulated so far. The expected number of consecutive accepted steps is approximately , and the sampler is correspondingly sensitive to the acceptance rate. GHMC therefore demands higher acceptance rates than HMC, typically rather than the that is optimal for the standard method, and attaining them demands either a smaller step size or a higher order integrator. This coupling is what motivates the modified Hamiltonians of Section 5 and the adaptive integrators of Section 7, since both raise the acceptance rate at fixed gradient cost, which in turn allows for a smaller and hence a longer effective trajectory. The optimal trajectory length is therefore a function of , and vice versa, and the two must be tuned together.
Conversely, a small lets the sampler accumulate motion across iterations and thus use shorter individual trajectories. In the adaptive integration family of Section 8 the recommended refreshment parameter scales as [85, 5],
where is the dimensionless step size and depends upon the integrator coefficients introduced in Section 7. Within that tuning scheme, very short trajectories are recommended, frequently and otherwise drawn uniformly from . This contrasts with the steps needed to maintain a fixed integration time for HMC under the product-target scaling of Table 2.
Remark 4.1.
The flip upon rejection is the principal structural weakness of GHMC, since a single rejection reverses the chain and, unless the acceptance rate remains close to unity, may cause the sampler to oscillate back and forth instead of continuing to explore the state space. Proposed remedies include delayed rejection schemes [82], which attempt a second and more conservative proposal before resorting to the flip, and non-reversible updates of the acceptance variable [88], which correlate successive acceptance decisions in order to reduce its frequency. The tuning-free scheme of Hoffman and Sountsov [58], known as MEADS, instead adapts and from an ensemble of chains so that the acceptance rate remains high enough for flips to be rare, and is designed for the multi-chain setting that arises naturally in modern parallel computing. Metropolis-adjusted Langevin trajectories [104] provide a rigorous contemporary treatment of essentially the same underlying construction.
5 Modified Hamiltonian Monte Carlo (MHMC)
5.1 Backward Error Analysis & Shadow Hamiltonians
Although Section 3 described numerical integration through the discretization error , backward error analysis offers a more informative interpretation, according to which a symplectic integrator follows the flow of a nearby modified, or shadow, Hamiltonian represented by an asymptotic expansion in the step size [52, 117]. Skeel and Hardy [120] give a practical construction of these expansions for simulation use. Truncating this series gives the -th order truncated modified Hamiltonian
in which is the order of the integrator and the correction terms are determined by the integrator coefficients, involving successively higher derivatives of the potential. For the palindromic schemes of Section 7, the odd-order corrections vanish, so only even powers of survive: carries a single correction and adds an one. Both are written out in Appendix A. For a suitably truncated expansion, the modified Hamiltonian is typically conserved to higher order than over an integration step, as illustrated in Figure 4 for the harmonic oscillator, whose trajectory follows a nearby closed energy curve associated with the modified Hamiltonian.
\theta$$p$$\mathcal{O}(\varepsilon^{m})$$H=\mathrm{Const.} (Exact Flow) (Numerical Flow)(a) Phase PortraitEnergyError\Delta H$$\Delta\widetilde{H}^{[k]} Acceptance Is Governed by This Spread Step Is Smaller Than by a Further Factor (b) Energy Error Along a Trajectory
Fig 4: Modified Hamiltonian interpretation of the Verlet integrator for the harmonic oscillator . (a) The dashed circle is a level set of the true Hamiltonian. The numerical trajectories lie on a nearby level set of the modified Hamiltonian (solid). For Verlet, this level set is an ellipse with eccentricity . (b) The error in the true Hamiltonian, , oscillates along the numerical trajectory. The truncated modified Hamiltonian has a smaller error . MHMC uses this quantity in the Metropolis test and reweights the resulting draws with (19).
Modified Hamiltonian Monte Carlo (MHMC) methods exploit this observation by sampling not from , but from the modified target
employing rather than in the Metropolis test. Because the integrator conserves far more closely than , acceptance rates can approach unity at step sizes that would be rejected outright under the true Hamiltonian. The original target must then be recovered by importance reweighting. Because , each sample carries a weight
and expectations under are accordingly estimated by the self-normalized estimator
MHMC thus combines Markov Chain sampling with importance sampling through the modified Hamiltonian, which also affects its diagnostics (Section 9).
Remark 5.1.
A modified Hamiltonian can improve acceptance and thereby allow larger step sizes or a smaller in a GHMC setting, but these gains come with the additional requirements of evaluating , either through higher derivatives of or suitable numerical approximations, and of controlling the variance of the resulting importance weights. The method is thus beneficial only when its improvement in mixing outweighs the loss of precision caused by variable weights. The two are not automatically aligned: a step size can produce near-perfect acceptance under and still yield weights dispersed enough that the self-normalized estimator in (20) is effectively driven by a handful of draws. Section 8 considers this trade-off, together with the joint tuning of the integrator and modified Hamiltonian needed to maximize overall sampling efficiency.
5.2 Shadow Hamiltonian Methods
Originating in molecular simulation and only later adapted to computational statistics, MHMC now comprises several related methods, of which the three described below differ principally in the manner in which shadow Hamiltonian corrections are combined with momentum updates and importance reweighting.
Shadow Hybrid Monte Carlo. SHMC [62] introduced the central idea of sampling from a shadow density and correcting the estimator by reweighting. It employed a fourth-order shadow Hamiltonian within an otherwise standard HMC setting and demonstrated substantial gains in acceptance for molecular systems, at the cost of a weight distribution that had to be controlled by a bounding parameter.
Generalized Shadow HMC. GSHMC [6] combines the shadow Hamiltonian construction with the partial momentum update of Section 4. Because is generally non-quadratic in , the rotation (15) no longer leaves the modified density invariant, and the momentum update must consequently be subjected to a second Metropolis test defined with respect to the extended Hamiltonian
which restores invariance of the joint density in under the rotation. For the standard Hamiltonian, is invariant by construction, so GHMC needs no analogous test.
Mix & Match HMC. MMHMC [101, 103] further specialized this framework to the field of computational statistics, where the potentials are Bayesian log-posteriors rather than molecular force fields and the derivative structure differs accordingly. It introduced practical fourth- and sixth-order modified Hamiltonians for multi-stage splitting integrators (Appendix A), a numerical derivative formulation that avoids explicit Hessians for dense problems, and the first systematic evaluation on statistical targets. Algorithm 3 differs from Algorithm 2 in three places: the momentum update is subjected to its own Metropolis test under , the trajectory test uses , and an importance weight is recorded after each iteration.
Algorithm 3 Mix & Match Hamiltonian Monte Carlo (MMHMC). Three things distinguish it from Algorithm 2: the partial momentum update carries its own Metropolis test under the extended Hamiltonian , the trajectory test uses the truncated modified Hamiltonian , and each iteration records an importance weight that returns the estimator to the original target.
1: Input:
| : | Number of Monte Carlo samples |
|---|---|
| : | Step size |
| : | Number of integration steps (trajectory length) |
| : | Mass matrix |
| : | Momentum noise parameter, |
| : | Order of the truncated modified Hamiltonian |
| : | Symplectic, reversible numerical integrator |
2: Output:
| : | Weighted samples for estimating |
|---|
3: Initialize
4: for to do
5:
6: // Partial momentum update:
7: Sample
8:
9:
10:
11: // Metropolis test on the momentum update:
12:
13: Sample
14: if then
15: // Momentum update accepted
16: else
17: // Momentum update rejected
18: end if
19: // Generate proposal by simulating Hamiltonian dynamics:
20:
21:
22: // Metropolis test on the trajectory:
23:
24: Sample
25: if then
26: // Proposal accepted
27: else
28: // Rejected: momentum flip
29: end if
30: // Importance weight recovering the original target:
31:
32: end for
33: Estimator:
5.3 Which Modified Hamiltonian & at What Cost
The order at which the expansion is truncated is itself a parameter to be adapted to the problem at hand: increasing it allows the integrator to conserve more accurately, and may therefore raise the acceptance rate while concentrating the weights, but each additional order also introduces higher derivatives of the potential. Thus, whereas the fourth-order modified Hamiltonian already requires the Hessian contracted against , the sixth-order expression additionally involves third derivatives, a requirement that is prohibitive for most statistical models of realistic size [102].
Two practical formulations are used to circumvent this problematic obstacle. When the required derivatives are inexpensive or sparse, as happens for many molecular potentials and for models with structured likelihoods, they may be evaluated directly through the analytic formulation. For statistical problems with dense Hessians, by contrast, the more common numerical time-derivative formulation replaces the higher derivatives with finite differences of gradients already computed along the trajectory, at the cost of introducing a second discretization error. The special case of a quadratic potential, which describes a Gaussian target and a sufficiently regular target locally near its mode, is simpler still, because all third and higher derivatives vanish, and it is this simplification that underlies the Gaussian analysis employed by the s-AIA and s-MAIA schemes of Section 8.
Because the coefficients entering these expressions depend upon the splitting parameters and , the choice of modified Hamiltonian is inseparable from that of the integrator, and the MAIA, e-MAIA, and s-MAIA schemes in Section 8 were therefore developed specifically for modified Hamiltonians instead of transferred directly from the standard HMC setting [4, 97].
Remark 5.2.
MHMC is not the only way of using integration accuracy more efficiently: extra-chance GHMC [29] continues a rejected trajectory rather than flipping the momentum at once, delayed rejection [82] makes a second attempt at a smaller step size, and Calvo et al. [28] obtain higher acceptance by replacing leapfrog with schemes designed around the acceptance rate directly. All three leave the invariant distribution of the chain untouched. However, MHMC does not: it changes the invariant distribution of the chain and repairs the change afterwards through reweighting, so its assessment requires the combined effective sample size of Section 9.3.3.
6 Riemannian, Non-Separable & Alternative Dynamics
The methods considered in Sections 4 and 5 retain three features of standard HMC: a constant mass matrix , a separable Hamiltonian, and an explicit integrator. The methods collected in this section relax one or more of these conditions in order to adapt more directly to difficult posterior geometries such as the funnel in Figure 1, albeit often at a substantial increased computational cost.
6.1 Riemannian Manifold HMC (RMHMC)
When posterior curvature varies considerably across the parameter space, constant preconditioning is insufficient to resolve the geometry equally well throughout the domain. To address this, Riemannian manifold HMC [45] replaces the constant mass matrix with a position-dependent metric tensor and draws momenta as . The resulting Hamiltonian includes a log-determinant term,
The canonical choice for the metric is the expected Fisher information of the likelihood, augmented by the negative Hessian of the log-prior,
which is positive definite when the prior contribution makes the sum positive definite and transforms appropriately under smooth reparameterization. This geometric invariance is an advantage of RMHMC over Euclidean HMC, particularly when parameterization affects conditioning. Moreover, a key difference from the methods of Sections 4 and 5, however, is that the Hamiltonian in (22) is non-separable, since and now appear together in the kinetic term. Hamilton’s equations thus become
and the usual leapfrog scheme no longer applies as neither equation can generally be solved exactly for one variable while the other is held fixed. RMHMC instead commonly employs the generalized leapfrog integrator [72, 52], an implicit symplectic integrator whose two half-steps require the solution of nonlinear fixed-point equations,
followed by an explicit half-kick. Implementing these updates requires repeated metric evaluations, linear solves, and metric derivatives, with a dense implementation incurring cost per evaluation of the Hamiltonian and its derivatives unless exploitable sparsity or other structure is present. RMHMC can therefore be substantially more expensive than euclidean HMC, while an insufficiently converged fixed-point solve may additionally compromise reversibility and bias the resulting transition.
Several subsequent developments have nevertheless made RMHMC considerably more practical. The SoftAbs metric [13] smoothly maps the eigenvalues of the Hessian to positive values and thereby supplies a metric when the Fisher information is unavailable or indefinite, as frequently occurs in hierarchical models with non-conjugate likelihoods. Lagrangian dynamical Monte Carlo [68] rewrites the dynamics in velocity rather than momentum coordinates, allowing an explicit, non-symplectic integrator that can reduce the computational burden. Lastly, explicit symplectic integration by augmentation [123, 33] duplicates the phase space into two copies and and couples them. The augmented Hamiltonian is separable across the copies and so admits an explicit splitting; the strength of the binding controls how long the two copies remain close, and hence how faithfully the scheme reproduces the original non-separable flow.
Remark 6.1.
On Neal’s funnel, a position-dependent metric rescales the local geometry toward isotropy and thus allows the neck and the mouth to be explored with comparable efficiency. Betancourt and Girolami [12] demonstrate this for the SoftAbs metric where a Euclidean metric fails. Non-centering and RMHMC thus attack the same obstacle from opposite sides, one by choosing coordinates in which the geometry is benign and the other by adapting the geometry to the coordinates given. The two are not equivalent, however: non-centering is a fixed global change of variables whose suitability depends on the prior–likelihood balance of each group, whereas the metric is re-evaluated locally at every point of the trajectory and pays for that flexibility at every step.
6.2 Non-Canonical & Alternative Dynamics
Rather than modifying the metric, a second family retains the Euclidean geometry and alters the dynamics themselves, leading to methods that address a narrower range of difficulties but are generally much less computationally demanding than RMHMC.
Magnetic HMC. Adding an antisymmetric magnetic field term to the equations of motion, so that , produces a flow that remains volume preserving and still leaves invariant, but is no longer time reversible in the usual sense [126]. The rotational component this introduces can carry trajectories through regions where standard Hamiltonian paths stall, at the cost of a further matrix to specify.
Relativistic HMC. Replacing the quadratic kinetic energy by a relativistic one, , bounds the particle speed by [75]. This can limit the effect of large velocities and may improve numerical stability in some challenging regions, but it does not remove the need to resolve the target’s geometry.
Microcanonical Samplers. Robnik et al. [112, 113] abandon the canonical ensemble altogether, evolving the state on a surface of constant energy under norm-preserving velocity dynamics and injecting noise only by rotating the velocity. The resulting Microcanonical Langevin Monte Carlo (MCLMC) carries no Metropolis test, so its stationary distribution retains a discretization bias controlled only by the step size. Against this the authors report scaling in dimension and condition number more favorable than that of NUTS, and speedups on standard benchmarks that reach orders of magnitude in the best cases. A Metropolis-adjusted variant [111] removes the bias at some cost in efficiency.
Discontinuous & Constrained Targets. Discontinuous HMC [92] extends the framework to discrete and discontinuous parameters by means of Laplace-distributed momenta and a coordinate-wise integrator that handles density jumps. Geodesic Monte Carlo [25] and constrained HMC [24] handle parameters living on manifolds such as simplices, spheres and orthogonal matrices, by splitting the flow into a geodesic part that is solved exactly and a potential part that is not.
6.3 Learned & Preconditioned Dynamics
A third family, originating largely in machine learning, attempts to learn a transformation of the target geometry: NeuTra [57] trains a normalizing flow and subsequently runs HMC in its latent space, where the transformed target may be better conditioned. L2HMC [73] parameterizes the leapfrog update with neural networks trained to increase the expected squared jump distance without sacrificing invertibility or a tractable Jacobian. Both approaches thus exchange an up-front training cost, together with the risk of learning an inadequate transformation, for the possibility of more efficient sampling once training has been completed.
Finally, stochastic gradient HMC [32] replaces the exact gradient with a mini-batch estimate and introduces friction intended to counteract the noise thereby injected, extending the method to very large data sets but leaving it unadjusted and, under naive subsampling, biased because the mini-batch noise disrupts the energy conservation required for an inexpensive Metropolis correction [14]. This approach is consequently of limited relevance to the joint models considered in Section 11, where the dominant cost arises from per-subject quadrature rather than the sheer number of observations. The principal properties of the methods discussed above are summarized in Table 4.
Table 4: Methods that modify the geometry or the dynamics. “Separable” refers to the Hamiltonian; “explicit” to whether an explicit symplectic integrator is available, and “exact” to whether the sampler targets without asymptotic bias.
| Method | Separable | Explicit | Exact |
|---|---|---|---|
| HMC / GHMC [87, 64] | Yes | Yes | Yes |
| MMHMC [101] | Yes | Yes | Yes † |
| RMHMC [45] | No | No | Yes |
| SoftAbs RMHMC [13] | No | No | Yes |
| Lagrangian MC [68] | No | Yes | Yes |
| Tao augmentation [123] | No ‡ | Yes | Yes |
| Magnetic HMC [126] | Yes | Yes | Yes |
| Relativistic HMC [75] | Yes | Yes | Yes |
| MCLMC [112, 113] | Yes | Yes | No |
| SGHMC [32] | Yes | Yes | No |
| NeuTra [57] | Yes | Yes | Yes |
† Exact after importance reweighting, as in (20). ‡ Non-separable, but separable in the augmented phase space.
7 Numerical Integration
In practice, the Hamiltonian dynamics of Section 3 can rarely be solved exactly and must instead be approximated numerically, making the choice of integrator considerably more than an implementation detail: it determines whether the resulting proposal map remains reversible and volume preserving, while the energy error it introduces governs the eventual acceptance rate. Since gradient evaluations ordinarily account for most of the cost of sampling, the design of an HMC integrator may consequently be viewed as the problem of extracting as much accuracy as possible from every such evaluation.
7.1 Integrator Splitting, Drifts & Kicks
Standard HMC splits the Hamiltonian into kinetic and potential parts, , each of which generates a flow that can be solved exactly,
customarily termed a position drift and a momentum kick, respectively. Since both are exact Hamiltonian flows, and thus symplectic, any composition of them inherits symplecticness. When the coefficients of that composition are also palindromic, the resulting map is also time reversible. This simple splitting of the Hamiltonian thus generates an entire family of useful integrators, of which the traditional Störmer–Verlet, or leapfrog, scheme [129] is the simplest representative, and is obtained from the composition
which is second order accurate at the cost of a single gradient evaluation per step, since the half-kicks of consecutive steps merge into one when the trajectory is iterated.
7.2 Multi-Stage Splitting Integrators (MSSIs)
Nothing, of course, compels the coefficients to be those in (28), and the leapfrog scheme is but one member of a broader family of multi-stage splitting integrators (MSSIs) that generalize the composition to more stages and free coefficients. Symmetric compositions of the flows in (27) with free coefficients are a classical construction in geometric integration [80, 52], surveyed for this setting by Bou-Rabee and Sanz-Serna [20], and the multi-stage splitting integrators they generate have been developed systematically for HMC [17, 4, 102, 84]. The general family of -stage splitting integrators, which leaves free parameters, is defined by
with coefficients subject to the consistency conditions
which ensure that the composition approximates the exact flow to at least first order. Time reversibility again follows from the palindromic structure, and symplecticness from the composition of Hamiltonian flows, so the requirements identified in Section 3 are met by construction for every admissible choice of coefficients. Note also that the number of stages coincides with the number of gradient evaluations performed per step of size .
Working through (30) for leaves a single free parameter and the composition
whereas leaves two parameters and
Campos and Sanz-Serna [30] show that outside the one-parameter subfamily satisfying
palindromic three-stage schemes have poor stability properties, and (33) is accordingly imposed throughout the HMC literature [17, 102, 84]. The Velocity Verlet, BCSS and minimum-error values of Table 5 all satisfy it, and under it, the error bound below is derived. Figure 5 illustrates the drift-kick structure of both schemes, whose coefficients, together with those of other common choices, are collected in Table 5.
VV-11 Gradient\varphi^{A}_{\varepsilon}$$\dfrac{1}{2}$$\dfrac{1}{2}2-Stage2 Gradients\varphi^{A}_{\varepsilon/2}$$\varphi^{A}_{\varepsilon/2}$$b$$1\!-\!2b$$b3-Stage3 Gradientsa$$1\!-\!2a$$a$$b$$\dfrac{1}{2}\!-\!b$$\dfrac{1}{2}\!-\!b$$b$$0$$\varepsilonTime Within One Integration StepPosition Drift Momentum Kick
Fig 5: Multi-stage splitting integrators (MSSIs) as sequences of kicks and drifts over one step of size . Position drifts (above the line) advance time; momentum kicks (below) are instantaneous and each costs one gradient evaluation, so the number of kicks per step is the number of stages . All sequences are palindromic, which gives time-reversibility, and all are compositions of exact Hamiltonian flows, which gives symplecticity. The free coefficients, namely for and for , distinguish the Velocity Verlet, BCSS and Minimum-Error schemes of Table 5. Values drawn here correspond to BCSS.
Remark 7.1 (Fair comparison between integrators).
Because a -stage integrator spends gradients on every step, a comparison at equal assigns different computational budgets to the competing schemes and is therefore misleading. The convention adopted throughout the literature [102, 84] fixes the gradient budget instead: if steps of size are appropriate for one-stage Verlet, a -stage scheme is run for steps of size , so that every scheme integrates the dynamics over the same interval and expends the same number of gradient evaluations in doing so. For precisely the same reason, the metric, introduced in Section 9 as the number of gradient evaluations per effective sample, provides a more comprehensively and fair measure of efficiency across integrators.
7.3 Choosing the Coefficients
Within each family of integrators, the free coefficients are fixed by optimizing some proxy for the energy error, since it is this error that drives the acceptance rate. Three choices of proxy, and hence three families of coefficients, are in common use in HMC.
Velocity Verlet Schemes. These simply concatenate Verlet steps of length , which amounts to for and to , for . They have the longest stability intervals in their families, in dimensionless units, and are the natural choice when stability, rather than accuracy, limits the step size.
Minimum-Error Schemes. These minimize a norm of the leading coefficients of the energy error in the limit [80, 100], namely the and of the fourth-order modified Hamiltonian of Appendix A. The criterion is not the same in the two families. McLachlan’s two-stage coefficient minimizes , whereas the three-stage pair of Predescu et al. [100] satisfies , which under (33) cancels the term of and leaves a truncation error of size . Both are thus optimal in the small step size limit, and by extension for high-dimensional problems in which accuracy already drives the step size down. Their stability intervals are the shortest in their families, and their advantage disappears quickly once the approaches the stability boundary.
BCSS Schemes. Blanes, Casas and Sanz-Serna [17] argue instead that integrators are not in fact operated at small step sizes, and minimize instead the maximum of the energy error bound over the interval on which a -stage scheme is typically run. The resulting coefficients sit between the Velocity Verlet and minimum-error values, as Table 5 shows.
The coefficients of these schemes are collected in Table 5. Which of them performs best depends on the step size regime of the problem at hand, which is rarely known in advance. The adaptive procedures of Section 8 address this caveat by estimating the regime during burn-in and then selecting to suit it.
Table 5: Coefficients of commonly used two- and three-stage splitting integrators, in the parameterization of (31) and (32).
Integrator Stages Coefficients 1-Stage Velocity Verlet (VV-1) 1 – 2-Stage Velocity Verlet (VV-2) 2 2-Stage BCSS (BCSS-2) 2 2-Stage Minimum-Error (ME-2) 2 3-Stage Velocity Verlet (VV-3) 3 , 3-Stage BCSS (BCSS-3) 3 , 3-Stage Minimum-Error (ME-3) 3 ,
7.4 Stability, Resonance & Expected Energy Error
Applied to the univariate harmonic oscillator , a -stage palindromic integrator reduces to a linear map,
where denotes the set of coefficients. The scheme is stable when , and the expected energy error admits a closed-form upper bound [17, 84]
whose explicit forms for and are given in Appendix A. Although derived for a Gaussian target, the bound remains informative for non-Gaussian ones [17], and near the mode of a smooth posterior. This carries two consequences of practical interest.
The first consequence concerns the scale of the step size: for the repeated Verlet -stage scheme, the dimensionless stability interval has length and its midpoint, termed the center of the longest stability interval (CoLSI), is . The adaptive schemes of Section 8 use this point as an anchor when constructing their randomization intervals, although it should be understood as a convenient heuristic reference rather than a strict limit, since the stability interval is problem dependent and may be shorter or longer than the Gaussian prediction.
The second consequence concerns resonance. Because the bound develops poles as , at which point the expected energy error diverges and instabilities arise for step sizes related to the periods of the system. An acceptance rate target by itself may fail to identify these regions reliably, particularly before the chain has encountered them, which motivates both the explicit modelling of and the randomization of step sizes used by the procedures described below.
7.5 Integrators for Modified Hamiltonians
For the MHMC methods of Section 5, the quantity to be conserved is rather than , and the coefficients must be re-optimized accordingly. Radivojević et al. [102] derive two- and three-stage families that minimize the energy error of the modified Hamiltonian, together with the coefficients appearing in the fourth- and sixth-order expansions of Appendix A. The resulting schemes differ from the BCSS and minimum-error coefficients of Table 5. Substituting the latter still gives a valid MHMC sampler, since validity rests on symplecticness and reversibility alone, but forgoes much of the advantage the modified Hamiltonian is meant to provide.
8 Hyperparameter Tuning
The methods introduced in Sections 4 through 7 involve several hyperparameters, for which convenient defaults may be unsuitable for a particular target and, even when valid, markedly inefficient. The tuning literature has consequently developed along two broad lines of work: one adapts parameters from the observed behavior of the sampler without positing an explicit model for the target, whereas the other fits a tractable surrogate, often multivariate Gaussian, during a burn-in period and uses the corresponding closed-form analysis. Table 6 compares these two approaches.
8.1 The Step Size
The most common approach applies stochastic approximation to the acceptance rate, adjusting throughout warm-up until the acceptance rate approaches a nominal target. Hoffman and Gelman [55] popularized Nesterov’s dual-averaging scheme [91] for this purpose, within the general framework for adaptive MCMC reviewed by Andrieu and Thoms [9]. The appropriate target is itself method dependent: the asymptotically optimal rate for Verlet-based HMC on high-dimensional targets with i.i.d. components is approximately [10], Stan adopts the more conservative default of in order to reduce divergent transitions, and GHMC-based adaptive integration schemes generally seek values of or higher because every rejection also reverses the momentum [84, 5].
Targeting the acceptance rate nevertheless has an important blind spot, because a scalar summary cannot distinguish a step size that is simply too large from one that is resonant in the sense of Section 7, nor can it reveal whether the observed acceptance is limited by ordinary integration accuracy or by proximity to the stability boundary. Procedures that estimate the stability interval directly avoid both ambiguities, although they do so at the additional cost of requiring curvature information.
8.2 The Trajectory Length
The trajectory length is more difficult to tune because it admits no direct analogue of the acceptance rate target: although short trajectories remain valid, they tend to produce strongly correlated draws, whereas long trajectories may spend gradients retracing regions that have already been explored. The No-U-Turn Sampler (NUTS) [55] addresses this problem through a local stopping criterion, recursively doubling a trajectory by integrating in randomly chosen forward or backward directions until its endpoints begin to turn back upon themselves, and subsequently selecting a state from that trajectory in a manner that preserves the target distribution. By removing the need to specify in advance, NUTS has consequently become the standard choice in Stan and a number of related frameworks.
Several later methods retain the idea of adapting the path length while changing the criterion by which this is done. ChEES-HMC [56] replaces the U-turn test with a differentiable objective, the Change in the Estimator of the Expected Square that is optimized by stochastic gradient ascent over an ensemble of chains and, because it avoids a recursive branching tree, can be vectorized across chains more readily than NUTS (Section 10). The apogee-to-apogee path sampler [119] instead segments a trajectory at successive maxima of the potential energy and reports efficiency comparable to HMC with markedly less sensitivity to its own tuning parameter, the number of apogees crossed. ATLAS [83] combines dynamic trajectory lengths with a step size derived from the local Hessian and a delayed rejection mechanism, aimed at targets whose curvature varies sharply from region to region.
At a more general level, GIST [18] treats the tuning parameters as auxiliary variables and samples them conditionally upon the current state , using a Metropolis-within-Gibbs correction to preserve the invariant distribution. Randomized HMC [19], multinomial HMC, NUTS, and the apogee-to-apogee sampler are recovered by different conditional distributions for the path length, so that algorithms ordinarily presented as separate constructions become instances of the same representation.
8.3 The Mass Matrix & the Riemannian Metric
During warm-up, samplers in the Stan family estimate either a diagonal or a dense mass matrix from draws collected over a sequence of expanding windows. A diagonal rescales the individual coordinates without accounting for their correlations, whereas a dense matrix performs both tasks at the price of storage, factorization during warm-up, and work at every leapfrog step, costs that may be prohibitive for joint models containing several thousand latent parameters. Moreover, neither choice fully resolves a funnel because the appropriate preconditioner varies with position, leaving the Riemannian methods of Section 6, the reparameterizations of Section 11, or preconditioning through a learned normalizing flow [57] as possible alternatives.
8.4 The Adaptive Integration Approach: from AIA to ATune
The adaptive integration line of work, first developed in molecular simulation and subsequently adapted to computational statistics, models the target rather than relying solely upon the observed behavior of the sampler. Near its mode, a smooth posterior is approximately Gaussian, in which case the integrator analysis of Section 7 becomes exact, is available in closed form, and the characteristic frequencies of the approximation determine both a stability interval and a suitable integrator coefficient. The frequencies are estimated once during burn-in and the map from step size to coefficient is pre-tabulated [84], so production sampling carries no adaptation overhead at all, in contrast to the per-iteration cost of the No-U-Turn family.
The adaptive integration family has evolved through several stages, from AIA [40], developed for standard Hamiltonians in molecular simulation, through MAIA and its extension e-MAIA [4], which treat modified Hamiltonians and additionally tune , to s-AIA [84] for computational statistics, s-MAIA [97] combining the two, and finally ATune [5], which generalizes the family so as to tune the integrator, the step size, the trajectory length and the momentum noise together, each with an accompanying randomization interval. Figure 6 displays the structure, which is common to all members of the family and consists of three stages.
(1) Tuning Stage Find a stable reference step size. •Short one-stage Verlet run with . •Every iterations, . •Stop once . \AR$$0$$0.5$$1$$\alpha_{\text{target}}\approx 0.92\pm\xi(2) Burn-In Stage Quantify the departure from harmonicity. •Cheap fitting factor from and , (36). , (37) (no Hessian) •Spectral summaries and . •Stability limit , (38). (3) Production Stage Randomize all parameters every iteration. \bar{\varepsilon}$$0$$2.0772$$k$$2k$$\bar{\varepsilon}\sim\mathrm{U}(2.0772,\,k) • minimizes the worst-case (40). •GHMC: , (16). •Dimensional . • if , else . \varepsilon_{\text{tuned}}$$S_{f} (or ), , , \mathrm{SL}$$\Psi^{(k)}_{\varepsilon} with drawn afresh at every iteration
Fig 6: The adaptive integration pipeline introduced by s-AIA and extended by ATune [84, 5], building on AIA and MAIA [40, 4]. The branch on shown in the burn-in stage follows s-AIA; ATune uses whenever the full frequency spectrum is computed. In contrast to the No-U-Turn lineage, which adapts online from the sampler’s own behavior, this family fits a multivariate Gaussian surrogate to the target during burn-in and then derives step size, integrator coefficients, trajectory length and momentum noise from the closed-form analysis of Section 7. There is no production-time overhead, since all adaptation happens before the sampling phase, and the outputs are randomization intervals rather than point values, which breaks integrator resonances. Parameters are drawn afresh from those intervals at each production iteration.
Tuning stage. A short one-stage Velocity Verlet run with adjusts the step size in increments until the acceptance rate lies within a tolerance of a target , derived in [84] as , the expected acceptance of this run at the center of the Verlet stability interval. The output, , is a reference scale for the stages that follow, not a production step size.
Burn-in stage. The sampler runs at the tuned step size and estimates a fitting factor , which measures how far the system departs from the harmonic model and by how much the harmonic stability limit must accordingly be shortened. The cheap estimate uses only the dimension and the observed acceptance rate,
where the largest frequency can be estimated without forming the Hessian [58]. In s-AIA, is adopted as whenever . If instead , indicating pronounced anharmonicity, the algorithm computes a more informative estimate of the stability limit based on the characteristic frequencies of the Gaussian surrogate: at each burn-in iteration it computes the eigenvalues of the Hessian and the characteristic frequencies , averages them over the burn-in to obtain , and replaces (36) by the frequency-weighted
With and the standard deviation of the frequency spectrum, the estimated stability limit for a -stage scheme is
the second branch shifting the reference frequency downward when the spectrum is broad, a situation that often arises in hierarchical models.
Production stage. The dimensionless step size is randomized within an interval whose right endpoint is the center of the longest stability interval, , identified in Section 7. For the three-stage scheme that ATune adopts, the left endpoint is fixed by the local maximum of lying to the left of , between which and the energy error stays small [5], giving
with the corresponding dimensional interval obtained by dividing through by , or by in the broad branch of (38). For each drawn , the integrator coefficient is then read from the pre-tabulated map, which minimizes the worst-case expected energy error over all dimensionless step sizes up to ,
For GHMC, the momentum noise is randomized over using (16), the ordering following from the monotonicity of on that interval. The trajectory length is set to when , the almost harmonic case, and otherwise drawn uniformly from , whose mean is the optimal length obtained by equating the expected energy errors of the harmonic and anharmonic regimes [5, 85].
Unlike the No-U-Turn line of development, these methods randomize parameters and use surrogate analysis before production sampling to avoid estimated regions of poor stability or accuracy [5]. Their effectiveness, however, depends on an informative Gaussian surrogate and, whenever the full frequency spectrum is required, on the cost of Hessian eigenvalues during burn-in, which can be prohibitive in high dimension.
Table 6: Adaptive tuning schemes for Hamiltonian samplers. The column headed “information used” distinguishes methods that observe the behavior of the sampler from those that fit a surrogate model of the target.
| Scheme | Tunes | Information used | Randomizes? | Overhead |
|---|---|---|---|---|
| Dual averaging [55] | Acceptance rate | No | Warm-up only | |
| NUTS [55] | U-turn criterion, per iteration | Implicitly | Per iteration | |
| Multinomial NUTS [16] | Generalized U-turn | Implicitly | Per iteration | |
| ChEES-HMC [56] | Ensemble second moments | No | Warm-up only | |
| A2A [119] | Potential energy apogees | Yes | Per iteration | |
| GIST [18] | Any | Gibbs conditional on | Yes | Per iteration |
| ATLAS [83] | Local Hessian, delayed rejection | Yes | Per iteration | |
| Bayesian adaptive [130] | , Metric | Optimization of expected squared jump | No | Warm-up only |
| AIA [40] | (given ) | Gaussian model, fixed safety factor | No | Setup only |
| MAIA, e-MAIA [4] | (given ) | Gaussian model, modified | No | Setup only |
| s-AIA [84] | , | Gaussian model, Hessian frequencies | Yes | Burn-in only |
| s-MAIA [97] | , (modified ) | As s-AIA, applied to | Yes | Burn-in only |
| ATune [5] | Gaussian model, Hessian frequencies | Yes | Burn-in only |
8.5 Which Scheme to Use
The choice between these families depends principally upon where the computational effort is best spent. No-U-Turn methods adapt at every iteration without requiring an advance model of the target and therefore provide a useful default when gradients are inexpensive and the local geometry varies substantially. Adaptive integration methods, by contrast, concentrate their additional work in burn-in and thereafter sample from fixed randomization intervals, which may make them preferable when gradients are costly, when GHMC or MHMC is used without a direct No-U-Turn analogue, or when resonance is a particular concern. On the benchmarks reported by its authors, adaptively tuned GHMC outperforms both fixed-parameter integrators and HMC [5]. Although, as the next section emphasizes, that conclusion also depends upon the effective sample size estimator on which the comparison is based.
9 Diagnostics & Sampling Efficiency
The samplers, integrators, and tuning schemes of the preceding sections are only as useful as our ability to tell whether they have worked, and comparisons among them, such as the one that closed Section 8, are only as reliable as the efficiency measure on which they rest. The diagnostics commonly used to assess the sampling quality and efficiency of Hamiltonian methods focus around three important pillars: whether the chains have mixed, how efficiently they estimate the quantities of interest, and whether their trajectories are running into unresolved geometric difficulties. All three matter and, unfortunately, no single diagnostic answers them all at once. We therefore consider each question in turn, before turning to the effective sample size, a quantity whose estimation is considerably less straightforward than its widespread and often unqualified use might suggest.
9.1 Metrics of Convergence
Potential Scale Reduction Factor (PSRF). The classical diagnostic of Gelman and Rubin [43] runs chains from dispersed initial values and compares the within-chain variance with the between-chain variance , where and are the variance and mean of chain and the mean across all chains. Forming the pooled estimate gives, in the degrees-of-freedom corrected form of Brooks and Gelman [22],
which tends to unity as the chains mix. Vehtari et al. [128] show that this classical form fails for heavy-tailed or infinite-variance targets, as well as for chains that share a common location but differ in scale. In its place, they propose a rank-normalized split , together with a folded variant that is sensitive to differences in scale. Their recommended threshold of is considerably stricter than the traditional value of , and adopting it changes practical conclusions more often than one might expect. When many short chains are run in parallel, the natural regime for hardware accelerators examined in Section 10, the nested of Margossian et al. [77] groups the chains into superchains and compares the variance within superchains with that between them. It thereby remains informative even in situations when the sampling phase is too short for the classical statistic to be meaningful.
Simulation-based calibration. Whereas the preceding diagnostics assess the behavior of a chain for one particular fitted model, simulation-based calibration [122] assesses the algorithm–model pairing over repeated experiments. Parameters are drawn from the prior, data are simulated conditionally on them, the model is fitted, and the rank of the true parameter among the resulting posterior draws is tested for uniformity. Systematic sampling bias can thus be detected even when the ordinary chain diagnostics look satisfactory, which makes the procedure particularly valuable for hierarchical models, whose narrow funnel regions may otherwise remain unexplored.
9.2 Diagnostics Specific to Hamiltonian Methods
Two further diagnostics, both essential for the models considered here, arise directly from the Hamiltonian construction and therefore have no exact counterpart among more general MCMC methods.
Divergent transitions. A divergence is recorded when the energy error accumulated along a trajectory exceeds a prescribed threshold, signalling that the integrator has encountered curvature that cannot be resolved at the current step size [15]. Such events indicate a risk of biased exploration, and their locations often reveal the region responsible for the failure. In funnel-shaped posteriors it is therefore useful to plot the divergent draws against the population scale, since they tend to concentrate at its lower values.
Energy Bayesian fraction of missing information. The E-BFMI addresses the other half of the mechanism described in Section 3, namely whether momentum refreshment moves the chain between energy level sets at all [15, 16]. It compares the variance of the energy changes induced by refreshment with the marginal variance of the energy. Values conventionally regarded as low, most often those below , indicate that the chain is confined to a narrow band of energies and is therefore not exploring the tails of the target, however well it appears to move within that band. Heavy-tailed marginals and funnel geometries can both produce this behavior without necessarily causing a corresponding failure in .
9.3 Sampling Efficiency: the Many Faces of the ESS
Draws produced by MCMC are correlated, and thus draws from a Markov Chain are not equivalent to independent draws. The effective sample size (ESS) formalizes this as the number of independent draws that would yield an estimator of equal variance,
in which denotes the ideal estimator built from independent draws. While the definition (42) is unambiguous, every estimator of it rests on assumptions, and the samplers of Sections 4 and 5 violate those behind the estimators most commonly applied to them. Figure 7 gives an overview, organizing the estimators by the source of variance that each is designed to capture.
Variance From Correlation(Markov Chain Monte Carlo)Variance From Weights(Importance Sampling) Reversible Chains Geyer IPSE / IMSE / ICSE Any Chain Spectral Density Ratio of Variances HMCNUTSMALAGHMCMDMCIrreversibleBoth Sources Product-of-Variances (52) Or Thinned Weights (50) (Breaks When ) GSHMCMMHMC Kong Ratio of Weights Huggins–Roy Family -Aware Sample-Aware Discrepancy-Based Ratio of Variances Plain IS
Fig 7: The ESS landscape. A sampler’s admissible ESS estimators are determined by which sources of variance it introduces, since an estimator is admissible only where its assumptions hold. Ordinary MCMC inflates variance through autocorrelation only (left). Importance sampling through weight dispersion only (right). Modified Hamiltonian methods through both (center), and require a combined estimator. Geyer’s initial-sequence estimators [44] rest upon a positivity theorem for reversible chains, whereas GHMC and its descendants are irreversible by design. Estimators making no reversibility assumption [99, 127] should be preferred there. The importance sampling estimators shown, which in turn presume independent draws, are Kong’s ratio of weights [66], the Huggins–Roy family and the - and sample-aware variants [37], the discrepancy-based families [79], and the ratio-of-variances estimator [2].
9.3.1 The ESS for Markov Chains
For a stationary chain, the variance inflation relative to independent sampling is governed by the autocorrelation sequence , which gives
Although the definition is straightforward, any practical estimator must truncate the infinite sum, and the various approaches differ precisely in how they do so.
Geyer’s Initial Sequence Estimators. Geyer [44] begins from the result that, for an irreducible, stationary, and reversible chain, the sums of adjacent pairs are strictly positive and decreasing, so that any departure from these properties in an observed sequence can be attributed to estimation noise. This observation gives rise to three estimators with progressively stronger smoothing. The initial positive sequence estimator (IPSE) truncates the sum before the first non-positive ; the initial monotone sequence estimator (IMSE), adopted by Stan and ArviZ, additionally replaces each by ; and the initial convex sequence estimator (ICSE) further replaces the sequence by its greatest convex minorant. The positivity on which all three rely, however, holds only for reversible chains, and so provides no justification for applying them to GHMC or its modified Hamiltonian variations, which are irreversible by construction (Section 4). In the empirical study underlying this survey, Geyer’s estimators were already unreliable for GHMC and deteriorated further for MMHMC, where importance reweighting introduces a source of dependence that the ordinary autocovariance sequence does not capture.
Spectral Density Estimators. These exploit the fact that the power spectral density is the Fourier transform of the autocovariance function, and estimate the sum in (43) from the spectrum evaluated at frequency zero [121]. This is the implementation provided by coda [99], and makes no assumption of reversibility.
Ratio-of-Variances Estimators. Vats et al. [127] apply (42) directly in the multivariate case, defining
in which is the sample covariance of the draws, a batch-means estimate [41] of the Monte Carlo covariance, and the number of parameters. The construction does not require reversibility, handles multivariate targets natively, and comes with a principled stopping rule: for a relative tolerance and confidence level , the required effective sample size must satisfy
For irreversible Hamiltonian samplers without importance weights, this estimator is therefore a suitable default.
9.3.2 The ESS for Importance Sampling
Importance sampling introduces a different inflation of variance, arising from dispersion of the weights rather than from correlation between draws. The classical estimator [66, 65] is based on the ratio of weights
which is bounded within and attains exactly when all weights are equal. Elvira et al. [37] catalogue its defects: it disregards the function being estimated and therefore claims the same quality of estimation for every integrand; it disregards the samples entirely, depending only upon the weights, and it is consequently blind to the case in which a few well-placed samples carry most of the information. These limitations have in turn motivated three broad families of alternative estimators.
The Huggins–Roy family, as presented by Elvira et al. [37], generalizes (46) to
i.e., the exponential of the Rényi entropy of order of the normalized weights, which recovers (46) at . The family is better behaved and more flexible than the classical estimator, but since it still depends on the weights alone, it shares both of the shortcomings described above.
The -aware ESS removes the first shortcoming by reweighting according to the integrand, setting and substituting these weights into (46). The sample-aware ESS, however, addresses the second limitation by partitioning the sample space into regions , collecting the samples in region through the index set , and forming a summary weight for each region, which gives
where the global and local factors are
with the weights renormalized within each region. The global factor penalizes spatial concentration of the samples, while the local factors measure how degenerate the weights are within each region. Martino et al. [79] provide an axiomatic treatment of the whole question, listing the symmetry, maximum, minimum, unicity, and stability conditions that an effective sample size ought to satisfy, and constructing entire families of discrepancy-based estimators that meet them. The ratio-of-variances idea also carries over to importance sampling [2], giving , with explicit estimators of and for both the unnormalized and the self-normalized case and a corresponding stopping rule.
9.3.3 The ESS for Joint MCMC & Importance Sampling
Since modified HMC is simultaneously a Markov Chain and an importance sampler, neither family of estimators applies to it on its own. Two rather different attempts have therefore been made to combine their respective corrections.
Thinned summation of weights. The approach adopted by Radivojević [103, 101] sets , thins the chain by keeping every -th sample, and applies (46) to the thinned subsample,
In this way, the importance sampling formula is applied to the estimated number of uncorrelated draws, but the approach has three practical limitations. First, the integer thinning interval stays equal to one unless , so thinning has no effect for a well-mixing chain. Second, the expression is undefined when , even though irreversible samplers such as MMHMC can legitimately reach an effective sample size above the nominal number of draws. Third, the procedure discards samples that have already been obtained at the cost of gradient evaluations.
Correction as a product of variances. The alternative avoids all three limitations by factorizing (42) according to its two sources of variance, namely the Markov Chain that generates draws from and the importance weights that map onto ,
which yields the estimator
Because the correction is applied only at the end, this estimator does not depend on thinning, remains defined for super-efficient chains, and uses every sample. The factorization (51) is heuristic, however, as it treats the two sources of variance as if they acted independently. Whether (52) consequently counts the same loss twice when the weights are dispersed and the chain mixes poorly remains an open question, to which Section 13 returns. A second open question concerns which to use in (52). The sample-aware estimator (48) is the natural candidate, since weight degeneracy in a reweighted chain is typically localized in space, but it requires a partition of the sample space, and no principled rule for choosing one exists. Table 7 summarizes the resulting recommendations, organized by the two properties of the sampler that determine which estimators are admissible.
Table 7: Admissibility of ESS estimators. “Reversible” refers to the Markov Chain and “reweighted” to the presence of importance weights. A dash indicates that the estimator is defined but that its supporting assumptions are violated.
| Sampler | Properties | Admissible ESS Estimator | ||||
|---|---|---|---|---|---|---|
| Reversible | Reweighted | Geyer | Spectral | Vats | MCIS | |
| RWMH, MALA | Yes | No | ✓ | ✓ | ✓ | – |
| HMC, NUTS | Yes | No | ✓ | ✓ | ✓ | – |
| GHMC | No | No | – | ✓ | ✓ | – |
| MDMC, SLDMC | No | No | – | ✓ | ✓ | – |
| Plain Importance Sampling (IS) | N/A | Yes | – | – | – | (46) |
| GSHMC, MMHMC | No | Yes | – | – | – | ✓ |
9.4 Derived & Cost-Aware Metrics
Several quantities derived from the effective sample size are useful when the aim is not only to diagnose a chain but also to compare the statistical or computational efficiency of competing samplers. The Monte Carlo standard error (MCSE) of an estimator is the standard deviation of its sampling distribution, which may be estimated from the effective sample size as
where is the posterior variance of the quantity being estimated. Reported alongside a posterior summary, it expresses the simulation uncertainty that remains in that quantity. The integrated autocorrelation time (IACT),
offers a more intuitive interpretation as the average number of iterations required for an effectively independent draw [121]. To compare computational efficiency rather than purely statistical efficiency, one may instead use a measure of sampling cost, such as the number of gradient evaluations per effective sample (),
in which is the number of integrator stages and the mean trajectory length, so that is the total number of gradient evaluations. Its reciprocal, the effective sample size per gradient evaluation , is the quantity reported in the adaptive integration literature [84, 5]. Either form supports the comparison across integrators described in Remark 7.1. A three-stage scheme that triples the effective sample size while also tripling the gradient cost, for example, leaves unchanged. This makes a useful metric whenever gradients dominate the runtime, although wall-clock time per effective sample is preferable when the cost of a single gradient differs between methods. Equation (55) is, however, a sequential measure of efficiency, as it assumes that gradients are always evaluated one after another. Section 10 revisits its interpretation under the paradigm of parallel execution. Table 8 summarizes this measure together with the remaining diagnostics introduced above.
Table 8: Summary of diagnostics and efficiency metrics.
Metric Assesses Eq./Ref. Acceptance Rate Space exploration (14) (rank-normalized) Convergence (41), [128] Nested Convergence, many chains [77] Divergences Unresolved curvature [15, 16] E-BFMI Momentum refreshment [15, 16] SBC Algorithm and model [122] Sampling efficiency (43) – (52) Estimation precision (53) Sampling efficiency (54) Computational efficiency (55)
10 Parallelism & Modern Hardware
The measures of computational cost and efficiency used thus far are intrinsically sequential. In particular, the metric in (55) counts gradient evaluations as though they were necessarily performed one after another, an assumption well suited to the analyses of Sections 7 and 8 but no longer inevitable on modern hardware accelerators such as graphics or tensor processors, where independent evaluations may proceed simultaneously. A sampler requiring twice as many gradients can, consequently, be faster in wall-clock time if it exposes enough parallel work, so rankings established from sequential cost may not carry over to multi-process or multi-core hardware. ChEES-HMC and MEADS, discussed in Section 8, were designed with this setting in mind.
Although the transition from to cannot itself begin before is known, parallel work may be exposed across independent or coupled chains, within a transition through multiple proposals, within an HMC trajectory, or during evaluation of the target and its gradient. These possibilities differ not only in cost, and expected benefit, but also in whether they preserve the exact invariant distribution, and are therefore summarized in Table 9. The quantum methods of Section 10.4 further accelerate proposal selection within this classification.
Table 9: Axes of parallelism in Markov Chain Monte Carlo. “Exact” indicates whether the construction leaves the invariant distribution of the sampler unchanged.
Axis Replicated Unit Buys Costs Exact Across chains The chain Variance, Warm-up, ✓ Coupled chains A pair of chains Removal of the bias Meeting time ✓ Multiple proposals The proposal Autocorrelation targets per step ✓ Parallel-in-time∗ The trajectory Depth, Processors, iterations ✓ Data sharding The gradient Wall-clock, exactly Communication ✓ Consensus / subposteriors The posterior Wall-clock Recombination error – Quantum multiproposal The selection step Loading, success –
∗ Established for gradient-free Metropolis chains [51]. Its extension to Hamiltonian trajectories remains open (Section 13).
10.1 An Exchange of Variance for Bias
The most common form of parallelism runs chains from dispersed initial states and pools the draws they produce, thus reducing the variance of a converged estimator by a factor of and its standard error by . Since the chains require no communication while they run, the calculation is embarrassingly parallel, but this independence also duplicates warm-up: whereas a single chain retaining draws after discarded iterations expends a fraction of its work on warm-up, such chains collectively spend the corresponding multiple .
Duplicating warm-up affects not only the computational cost but also the bias of the estimator. Increasing the number of chains reduces only the variance of the pooled estimate, whereas the initialization bias that remains is set by the sequential length of each chain, since its retained draws follow the law of the chain after steps rather than . At fixed , increasing can therefore make the Monte Carlo error arbitrarily small without removing initialization bias, a trade-off made especially prominent by accelerators that render many concurrent chains inexpensive while leaving the length of each chain unchanged.
Recent work addresses different aspects and consequences of this problem. The nested [77], introduced in Section 9, remains informative for short chains in regimes where the classical statistic may not due to the bias of the within-chain variance estimator, and the globally centered autocovariances of Agarwal and Vats [3] reduce the bias of autocorrelation-based estimators when many short chains are pooled. Margossian and Gelman [76] study the allocation of a fixed budget between and . Brown [23] further derives a non-asymptotic error bound for an estimator based on many short chains under a drift condition and an importance sampling proposal. Pathfinder [132] reduces directly by replacing stochastic warm-up with variational initialization.
Removing bias by coupling. Jacob, O’Leary and Atchadé [63] couple two chains until they meet almost surely and apply the telescoping argument of Glynn and Rhee [48] to their difference, obtaining an exactly unbiased estimator after a random but almost surely finite meeting time, independently replicated versions of which may then be averaged across processors. Heng and Jacob [54] construct corresponding couplings for HMC by sharing the random numbers used for the momenta and introducing a contractive refreshment coupling. Although the approach is not yet implemented in the mainstream packages listed in Table 10, its more fundamental limitation is that the meeting time continues to depend upon the mixing of the underlying kernel, so the same geometries that prolong warm-up may also delay coupling.
10.2 Within the Chain: Multiple Proposals
A second, and quite different tradition, parallelizes the state transition itself by generating multiple proposals at each step and selecting among them. Tjelmeland [125] showed how to augment the current state with proposals drawn jointly from a distribution conditioned on it, forming a pool in which the current state occupies one position, and select the next state from this pool with probabilities
where denotes the pool with removed and is the density of the remaining points had they been proposed from . This selection preserves detailed balance for every . Calderhead [27] gave a general construction of the same kind for Metropolis–Hastings, and Glatt-Holtz et al. [46] placed the accumulated variants within a single theoretic framework on an extended phase space, covering Metropolis-type and Barker-type acceptance criteria alike and clarifying which joint proposal structures admit the instead of the evaluation of the denominator in (56). Most recently, the same authors [47] studied the kernel obtained in the limit and use it to discriminate between schemes: if this limiting kernel is degenerate, additional proposals bring little further improvement, and the extra computational resources they occupy are largely wasted.
The benefit of multiple proposals is thus a lower autocorrelation between successive states and, for multimodal targets, a better chance of moving between modes whenever some of the proposals land beyond the low-density region that separates them. This benefit is paid for with target evaluations at every transition, on processors that could otherwise run additional independent chains. Whether the hardware is better spent on more proposals or on more chains therefore depends on the problem and on the geometry of the target.
Multiproposal MCMC has seen limited use with HMC because its proposals must be conditionally independent given the current state to be generated concurrently. The states of an HMC trajectory instead form a recursion, with each state requiring the gradient at its predecessor. Multinomial NUTS [16, 55] selects among trajectory states, and GIST [18] represents this selection as a Gibbs step, but those candidates are produced sequentially at a serial depth of gradient evaluations. A parallel proposal scheme for HMC would thus require independent trajectories and times the gradient cost. It is therefore a different use of computational budget from a single coherent Hamiltonian trajectory.
10.3 Within the Trajectory: Parallel-in-Time
Since the construction of requires , the leapfrog recursion has a serial depth of , and a trajectory must nevertheless be long enough to traverse an appreciable portion of the typical set. Thus, the mechanism that gives HMC its coherent exploration is also the principal obstruction to parallelism within a trajectory. Grazzi and Zanella [51] circumvent an obstruction of this kind by recasting a sequence of states as the fixed point of a Picard map, which allows all of them to be updated simultaneously and, for log-concave targets, converges in parallel iterations using processors. Although their construction is developed for gradient-free Metropolis chains, the leapfrog update is itself a recursion of the same kind and may therefore admit a related treatment. Such a reduction cannot, however, be pushed arbitrarily far, since the lower bounds of Zhou et al. [133] show that, for log-concave targets, depth may be reduced but not eliminated, with nearly linearly many adaptive rounds still required.
Parallelizing the target. For a model with conditionally independent observations, , and its gradient parallelizes exactly without changing the invariant distribution. Holbrook et al. [59] report speedups of more than two orders of magnitude for HMC from this strategy. In the joint models of Section 11, the dominant cost is the per-subject quadrature for the cumulative hazard, so it can be distributed over independent subjects. This approach differs from divide-and-conquer schemes such as consensus Monte Carlo [118], embarrassingly parallel MCMC [89], and Gaussian process subposterior merging [90], which shard and approximately recombine the posterior. For these models, parallelizing the gradient retains exactness and is a more direct route to speedup.
10.4 Quantum Parallelization
Holbrook [60] identifies the selection step (56) as the rate-limiting operation of a multiproposal scheme and notes that the Gumbel-max trick turns it into a discrete optimization problem: drawing is equivalent to computing for independent standard Gumbel variates , in which the normalizing constant making (56) computationally expensive cancels. Grover search and the Dürr–Høyer quantum minimization algorithm solve such a problem over items in oracle calls rather than , and the current state of the chain provides a warm start that further improves the constant. The number of target evaluations per transition thus falls from to , or from to once the pairwise terms of the Tjelmeland correction are taken into account. Lin et al. [74] address the remaining classical cost of generating the proposals by adopting a Tjelmeland distribution that concentrates them near the current state, and report target evaluations using qubits. A separate line of work, in which a quantum device supplies the proposal and the acceptance test remains classical [71], reports polynomial speedups for Boltzmann distributions of Ising models, although Orfi and Sels [93] show that the spectral gap of such samplers is bounded, and that for unital proposals, including the unitary dynamics used in practice, no speedup over classical sampling is possible on worst-case problems without exploitable structure.
This approach nevertheless faces three important limitations. For a continuous target, every transition must load classical bits, where denotes the floating-point width, and logarithmic loading depth does not eliminate that requirement. Moreover, quantum minimization succeeds only with probability , so that the implemented kernel differs from the intended one and, although the resulting bias appears empirically small, no available bound relates to the distance between and the invariant distribution actually obtained. Most importantly for the present survey, the method accelerates the selection among proposals only after those proposals have been evaluated, whereas the gradient-based samplers considered here spend most of their time generating them, and its immediate relevance to Hamiltonian sampling is therefore limited. The Gumbel-max reduction is also useful independently of quantum hardware, since its representation of the acceptance step as a discrete optimization problem applies equally to algorithms implemented on classical processors.
10.5 Implications for the Surveyed Methods
For the methods considered in this survey, the previous discussion has several practical implications.
Control flow on accelerators. On single-instruction multiple-data (SIMD) hardware, all chains advance in lockstep, so that the cost of an iteration is set by the longest trajectory, , rather than by the mean . Because the recursive doubling of NUTS lets each chain choose its own trajectory length , much of the hardware may sit idle while the longest trajectory completes. ChEES-HMC [56] avoids the recursive U-turn tree altogether, MEADS [58] adapts its parameters from an ensemble of chains, and microcanonical samplers [112, 111] use a fixed number of steps per trajectory. Since gradient cost and wall-clock time on an accelerator do not necessarily rank these methods in the same order, both and the wall-clock time on clearly specified hardware should thus be reported as standard practice.
GHMC and vectorization. GHMC and its descendants are particularly well suited to vectorized execution: their trajectories have a fixed and often short length, they require no recursive tree construction, the partial momentum update (15) is affine, and the multi-stage integrators of Section 7 are fixed compositions of simple maps. Every chain therefore follows the same control flow during a GHMC or MMHMC transition and, since the reweighting of Section 5 acts elementwise, these methods can thus be vectorized across chains with little effort. pyHaiCS [39], a Python and JAX reimplementation of the HaiCS package in which GHMC and MMHMC have so far been available (Section 12), follows this route to run them on accelerators.
Importance weights and many chains. The combined effective sample size (52) is defined for a single reweighted chain, but when chains are run the importance weights may be normalized either separately within each chain or jointly across all pooled draws. Normalizing within each chain yields self-normalized estimators, each with a bias of order that may be appreciable when the chains are short. Normalizing across the pool reduces this bias, but couples the chains and thereby breaks the independence on which both the variance argument and the nested rely. An extension of the combined estimator that accounts for this setting has yet to be developed.
11 Hierarchical Models in Practice
After the preceding discussions on the algorithmic samplers, integrators, and sampling diagnostics of Sections 4 through 9, we now return to the motivating example of hierarchical models. The hierarchical structure of these models often leads to challenging posterior geometries, such as funnels, that can impede efficient sampling. In this section, we explore practical strategies for addressing these challenges, including reparameterization techniques, marginalization approaches, and considerations specific to joint models for longitudinal and time-to-event data.
11.1 Reparameterization & Why It Is Not Sufficient
The usual first response to a funnel is to replace the centered parameterization of (5) with the non-centered version in (6). Papaspiliopoulos, Roberts and Sköld [96] showed, however, that these two are not the only options but rather endpoints of a continuum of partially non-centered parameterizations. In the explicit per-variable form used by Gorinova, Moore and Hoffman [49], the Gaussian hierarchy of (5) becomes
so that , with recovering the centered coordinate and the non-centered coordinate of (6). The efficiency of a Gibbs-type sampler depends considerably on where each is placed between these two extremes [96].
Moreover, Betancourt and Girolami [12] provide a geometric interpretation of this result in terms of the relative contribution of the prior and the likelihood to the posterior of each group . When the likelihood dominates, as it may for a group contributing many informative observations, the centered parameterization is often preferable, whereas for a data poor group dominated by the prior, non-centering frequently improves the conditioning by removing the prior dependence on . In their analysis, non-centering is effective precisely when it removes a dependence between layers that the data have not already broken, and ineffective when the data have already broken it. They also add an important caveat: models for which the centered parameterization is clearly preferable often contain enough data per group that the partial pooling of a hierarchical model is hardly needed in the first place.
Real hierarchical models, however, seldom exhibit a uniform balance between prior and likelihood. Some patients in a clinical study may contribute dozens of measurements and others only a few, just as site sizes may vary widely in a multi-center trial. The likelihood may therefore dominate for some groups and the prior for others, so that no single parameterization is ideal for all of them. This motivates either a hand-crafted mixture of centered and non-centered coordinates, the partially non-centered form in (57) with tuned weights , or a learned interpolation such as the variationally inferred parameterization of Gorinova, Moore and Hoffman [49].
11.2 Marginalization & Hybrid Schemes
Marginalization provides a different way of removing the source of the difficult geometry. Whenever the latent parameters enter the model as conditionally Gaussian variables, they may be integrated out analytically, leaving HMC to target only the hyperparameters. INLA [115] carries out this integration deterministically for latent Gaussian models and has been extended specifically to joint models [116]. Margossian et al. [78] instead embed an adjoint-differentiated Laplace approximation within HMC, so that the approximate marginal density and its gradient remain inexpensive to evaluate. HMC then samples the hyperparameters with respect to this approximate marginal, while the latent field itself is only approximated.
For non-Gaussian latent structures, a class that unfortunately includes most survival submodels, exact marginalization is not available, and the resulting approximation error must be assessed by other means, typically through simulation-based calibration. For joint models specifically, we are aware of no such assessment, which makes this an obvious target for future work.
11.3 Joint Models for Longitudinal & Time-to-Event Data
A joint model [106, 8] links a longitudinal submodel for a repeatedly measured biomarker to a survival submodel for an event time through shared random effects. In the shared-parameter formulation, for subject ,
in which are subject-specific random effects, is a baseline hazard, and couples the two submodels. The posterior over and the baseline-hazard parameters, is hierarchical in the sense of Section 2.3, and three of its features are particularly important from a computational point of view.
Multiple funnels. Each variance component in forms a funnel with the corresponding random-effect coordinates, so that a model with random effects per subject contains such structures, which are further coupled through the off-diagonal entries when is unstructured. Non-centering is standard practice here, but by the argument above it suits only subjects with few measurements, whereas longitudinal studies may contain subjects whose numbers of measurements vary widely.
Expensive gradients. The survival likelihood depends on the cumulative hazard , which has no closed form when varies with time and must therefore be approximated by numerical methods, typically Gauss–Kronrod or Gauss–Legendre quadratures, ordinarily with seven to fifteen nodes for every subject at every likelihood evaluation. Since each node requires a fresh evaluation of the longitudinal trajectory and of its derivative with respect to every parameter involved, the resulting gradients may be one or two orders of magnitude more expensive than those of a comparable generalized linear mixed model. The cost per gradient evaluation is consequently far more informative here than the ESS per iteration alone.
Dimension growing with the cohort. The latent dimension is , so that a cohort of one thousand subjects with a random intercept and slope already implies two thousand latent parameters before any fixed effects are counted. At this scale, dense mass matrices often become impractical, and the metric operations of naive RMHMC implementations can become prohibitive. The resulting need for diagonal or low-rank approximations to the mass matrix, however, may further exacerbate the funneling problem.
In practice, NUTS with a non-centered parameterization, as implemented in stan_jm [21], remains a sensible default, although its cost varies from one iteration to the next and may become substantial when long trajectories are built in flatter regions of the posterior. A GHMC sampler with short randomized trajectories and an ATune-family tuning scheme [5] offers a more predictable alternative, in which persistent momentum may preserve coherent movement across iterations and modified Hamiltonians may further improve acceptance, provided that the importance weights remain well behaved. Whether this combination actually outperforms NUTS on realistic joint models has yet to be established. A credible comparison will require an ESS estimator suited to a sampler that is both irreversible and reweighted, a setting in which the standard Geyer-based estimator reported by Stan is not justified.
11.4 A Practical Checklist
Previous sections have discussed the challenges of Hamiltonian sampling in the context of hierarchical models and the methods available to address them. We conclude with four recommendations for applying the methods discussed here to hierarchical models, which we summarize below as a checklist.
Parameterization. Begin with a non-centered parameterization for data-poor groups, but examine the balance between prior and likelihood across the hierarchy. Where this balance differs appreciably between groups, consider a mixed or learned parameterization [49].
Diagnosis. Inspect divergences, trace plots, E-BFMI, and ESS together, since each detects a different mode of failure in the sampling process. Report the rank-normalized against the threshold [128], and accompany every posterior summary with its Monte Carlo standard error.
Comparison. Compare samplers by gradient evaluations or wall-clock time per effective draw rather than by ESS per iteration, and state which ESS estimator was used and why its assumptions hold for the transitions in question.
Validation. Check every new model–algorithm pairing by simulation-based calibration [122] before trusting its output. Trace plots alone are insufficient and a single successful run does not guarantee correctness and robustness.
12 Software
The methods surveyed here differ considerably in their practical availability. The distance between an algorithm described in a paper and one supported by a maintained, well-tested implementation determines which methods reach applied work at all. Table 10 summarizes where that line currently falls. The entries reflect the state of these packages in September 2026 and will date quickly.
The Stan ecosystem [31] is the reference implementation for most users: NUTS with dual averaging, adaptation of either a diagonal or dense mass matrix, divergence and E-BFMI diagnostics, and rank-normalized together with its associated ESS estimators through the posterior and ArviZ packages [67, 128]. Those ESS estimators are Geyer’s, with the consequences discussed in Section 9. For joint models, this sampling machinery is exposed directly by stan_jm in rstanarm [21], whereas JMbayes2 [105] relies upon a bespoke C++ sampler with problem-specific blocking that may be faster for the models it was designed to fit, but is correspondingly less transferable to other hierarchical structures.
JAX-based libraries have become a particularly common setting for methodological development because they combine automatic differentiation and execution on hardware accelerators with readily vectorized transition kernels. NumPyro [98] and BlackJAX [26] both provide vectorized NUTS, but their scope beyond it differs. NumPyro concentrates on variants of HMC suited to particular model classes, among them energy-conserving subsampling and Gibbs updates for discrete latent variables. BlackJAX is the broader of the two for the methods surveyed here, offering GHMC, MEADS adaptation, MCLMC and its Metropolis-adjusted variant, RMHMC, ChEES adaptation, and the two- and three-stage splitting integrators of Section 7. Lao et al. [70] set out the design considerations behind this class of library, whose statistical implications were examined in Section 10. TensorFlow Probability [34] includes ChEES-HMC and several of the ESS estimators of Section 9, while PyMC [1] sits between these ecosystems in interface and scope, providing HMC and NUTS but none of the generalized or modified variants.
The modified Hamiltonian and adaptive integration branch of the literature has been, however, available almost exclusively through the in-house HaiCS package [103, 5], which implements GHMC, MMHMC, multi-stage splitting integrators, and the s-AIA and ATune tuning procedures. This narrow implementation base has probably constrained the use of these methods outside the groups that developed them, and provides the principal motivation for our Python and JAX port pyHaiCS [39].
Table 10: Availability of the surveyed methods. A check mark denotes a first-class implementation, an open circle denotes availability through our pyHaiCS extension, and a blank entry denotes unavailability.
| Stan | PyMC | NumPyro | BlackJAX | HaiCS | |
|---|---|---|---|---|---|
| HMC / NUTS | ✓ | ✓ | ✓ | ✓ | ✓ |
| GHMC | ✓ | ✓ | |||
| MMHMC | ✓ | ||||
| RMHMC | ✓ | ||||
| MCLMC | ✓ | ||||
| MEADS | ✓ | ||||
| ChEES-HMC | ✓ | ||||
| Multi-stage integrators | ✓ | ✓ | |||
| s-AIA / ATune | ✓ | ||||
| Rank-normalized | ✓ | ✓ | ✓ | ✓ | ✓ |
| Divergences / E-BFMI | ✓ | ✓ | ✓ | ✓ | |
| ✓ | |||||
| Combined MCIS ESS |
Table 10 also makes two practical points about the current state of the field. RMHMC still lacks a general production quality implementation because each model requires its own metric and metric derivatives, objects that mainstream probabilistic programming systems do not presently supply automatically. At the same time, those systems report neither nor a combined effective sample size accounting for both Markov Chain and importance sampling variance together. The former restricts routine use of position dependent geometries, while the latter prevents standardized comparisons among integrators and complicates the evaluation of the reweighted importance samplers discussed in Section 5.
13 Challenges & Open Directions
We finally conclude by distinguishing limitations that remain intrinsic to the available methods from those gaps that arise in their implementation, diagnosis, and empirical evaluation in current practice.
13.1 Limitations of the Methods
Multimodality. HMC struggles to cross regions of negligible density, since energy conservation confines each trajectory to a level set and leaves any mode behind a barrier higher than the available kinetic energy out of reach from the current state. Momentum resampling helps only when the energy distribution has sufficient spread, as measured by the E-BFMI (Section 9). The remaining options, namely parallel or continuous tempering [50], Wormhole HMC [69], transport by normalizing flows [57], and hybrids with sequential Monte Carlo (SMC), all require either prior knowledge of the modal structure or a separate training stage. Because label switching and unidentified variance components are common sources of multimodality in hierarchical models, the lack of general gradient-based solutions remains a significant practical limitation.
Mixed-regime hierarchical models. When the balance between prior and likelihood varies across groups, neither the centered nor the non-centered parameterization is appropriate throughout. RMHMC can in principle accommodate this variation, but may be prohibitively expensive at the dimensions involved, whereas automatic reparameterization [49] introduces an approximation of its own. A method that is simultaneously inexpensive, exact, and sufficiently general for routine use has yet to be developed.
Discrete parameters. Although discontinuous HMC [92] extends the framework to discrete or discontinuous targets, there remains no automatic and general purpose solution comparable to that provided by ordinary HMC in continuous spaces, leaving latent-class joint models, mixture cure models, and change-point survival models beyond the reach of standard Hamiltonian tooling.
Non-separable dynamics. RMHMC relies upon an expensive implicit generalized leapfrog whose fixed-point iteration may fail to converge and thereby compromise both reversibility and correctness. Explicit alternatives based upon phase-space augmentation [123, 33] or Lagrangian coordinates [68] avoid this particular difficulty, but their behavior on statistical targets is not yet characterized as thoroughly as that of the standard method.
Modified Hamiltonians beyond Euclidean metrics. MHMC changes the Hamiltonian used in the Metropolis correction, whereas RMHMC changes the underlying metric. Combining the two would require a modified Hamiltonian for a position-dependent metric, which does not appear to have been developed so far. Such a construction would nevertheless be attractive, as it could address integration error and geometric anisotropy within a single sampler.
The cost of gradients. When evaluating a likelihood requires additional quadratures, the solution of differential equations, or large scale linear algebra, its gradient may dominate the total runtime, and naive data subsampling does not remove this limitation for HMC [14]. For joint models in particular, the relevant expense lies in per-subject quadrature rather than simply in the number of observations. Improvements to the integrator, together with surrogate and multi-fidelity models, may therefore prove more valuable in this setting than changes to the transition kernel alone.
13.2 Gaps in Practice
Effective sample size. Section 9 identified a methodological gap between the default estimators of widely used software, which generally assume reversibility, and an important class of samplers that are irreversible by construction. No consensus estimator exists for draws that are both autocorrelated and importance reweighted, and the combined estimator (52) has yet to receive a complete theoretical analysis. Several questions therefore remain open: whether its product-of-variances correction counts the same loss twice when the weights are dispersed and mixing is poor, how the partition for the sample-aware should be chosen, and whether Geyer’s positivity argument admits an irreversible analog or must give way to batch-means estimators such as that of Vats et al. [127].
Autocorrelation estimators for irreversible chains. Fang, Cao and Skeel [38] show that generalized hybrid Monte Carlo belongs to a class of “modified reversible” propagators, each composed of a reversible substep and a measure preserving involution, whose transfer operators are self-adjoint. Since self-adjointness underlies Geyer’s positivity and monotonicity results in the reversible case, the natural question is whether those results carry over to this extended class. If they do, the default estimators reported by mainstream software would be justified for GHMC after all, and much of the difficulty described above would disappear. The same authors also observe that the momentum flip defeats the very purpose of introducing momenta, which raises the complementary question of whether a GHMC variant can avoid the flip without losing the variance benefits of irreversibility.
Initialization and warm-up. The choice of initial state receives comparatively little attention, even though running chains reduces the Monte Carlo error only by a factor of , multiplies the warm-up overhead from to , and leaves the initialization bias untouched. Pathfinder [132] attempts to lighten this burden through variational initialization, and many short chain methods [77, 76] revisit the allocation between chain length and the number of them. Initialization nevertheless remains consequential whenever accelerators make concurrent chains inexpensive without shortening the warm-up that each of them requires.
Multi-chain reweighted samplers. With reweighted chains, the importance weights may be normalized either within each chain or across the pooled draws. Normalizing within each chain yields self-normalized estimators, each with a bias of order that may be appreciable when the chains are short. Normalizing across the pool reduces this bias, but couples the chains and thereby breaks the independence on which both the variance argument and the nested rely. How (52) should be extended to this setting has not yet been studied.
Parallel-in-time dynamics. The serial depth of a trajectory limits parallelization within HMC, although the Picard-map construction of Grazzi and Zanella [51] shows that, for log-concave targets, this depth can be reduced by a factor of . Their method was developed for gradient-free Metropolis chains, but the leapfrog update is also a recursion and may admit a comparable fixed-point representation. This raises the question of whether the multi-stage integrators of Section 7 would retain their symplecticness, and with it the validity of the acceptance test, under such an iteration. Whatever the answer, the lower bounds of Zhou et al. [133] limit the reduction that can ultimately be achieved.
Two approaches to tuning. GIST [18] samples the tuning variables conditionally on the current state, whereas the adaptive integration family [5] derives them from an explicit surrogate model, and the two approaches have so far developed largely in isolation. However, a common framework relating GIST-style conditional distributions to the Gaussian analysis underlying and its associated stability interval would clarify whether their respective advantages can be combined.
Benchmarking. Published comparisons differ in their effective sample size estimators, their cost measures, their acceptance rate targets, and their tested models, and most are reported by the authors of the method being favoured. Since Section 9 shows that the choice of ESS estimator alone can change which sampler appears better, these comparisons cannot be meaningfully set against one another. A shared benchmark for hierarchical models should therefore report both and wall-clock cost, together with an ESS estimator whose assumptions hold for each of the samplers being compared.
14 Conclusion
Hamiltonian Monte Carlo is most usefully viewed not as a single algorithm but as a family of related design choices, for which generalized HMC provides one convenient organizing framework: varying the trajectory length, the degree of momentum refreshment, and the presence of a Metropolis correction recovers several familiar samplers, with further extensions modifying the metric, the Hamiltonian used by that correction, or the numerical integrator itself. The associated tuning problem has a similarly broad structure, ranging from NUTS-style adaptation driven by the observed behavior of the chain to adaptive integration methods whose parameters are derived from a surrogate fitted during burn-in.
Hierarchical models bring several of these choices into play simultaneously, since funnel-like geometry can render a single global step size or metric inadequate while the latent dimension itself continues to grow with the data. For the joint models considered here, gradients may also be sufficiently expensive that evaluations per effective sample and wall-clock time convey more than ESS per iteration, a distinction that exposes a further weakness in current benchmarking: effective sample size has no universally valid estimator, and the defaults used in practice may be inappropriate for irreversible or reweighted chains. Any comparison involving such methods should consequently state both the ESS estimator and the computational cost measure explicitly, so that an apparent advantage can be interpreted in light of the assumptions on which it rests.
A Modified Hamiltonians & Integrator Coefficients
For ease of reference, this appendix collects the expressions used in Sections 5 and 7, following the derivations of Radivojević et al. [102, 101] and Nagar et al. [84].
A.1 Fourth- & Sixth-Order Modified Hamiltonians
For the symmetric splitting integrators of (29), the truncated modified Hamiltonian in the analytic formulation is, to fourth order,
and, to sixth order,
in which , , and denote the first to fourth derivatives of the potential, the last two acting as multilinear forms on their bracketed arguments. For a quadratic potential such as a Gaussian target, and approximately for a target near its mode, the third and fourth derivatives vanish and (61) reduces to
It is this simplification that underlies the Gaussian analysis employed by the s-AIA and s-MAIA schemes of Section 8. When the Hessian is instead dense and expensive to evaluate directly, an equivalent numerical time-derivative formulation replaces its higher derivatives by finite differences of quantities already computed along the trajectory [102].
A.2 The Coefficients
Two-stage integrators. For the one-parameter family of (31) with , the coefficients are
Three-stage integrators. For the two-parameter family of (32) with , they become
For , the scheme consists of three Verlet steps of length , and the coefficients reduce to the one-stage values , , , , and divided by for the first two and by for the rest. The three-stage expressions for printed in [102] do not satisfy this check, and those given above were rederived from the Baker–Campbell–Hausdorff expansion.
A.3 The Expected Energy Error Bound
Applied to the harmonic oscillator , whose equations of motion are and , a -stage palindromic integrator acts as the linear map of (34), and the bound (35) specializes as follows. For ,
whereas for it is convenient to name the numerator and denominator separately, writing
with
where the three-stage coefficients are restricted to the one-parameter family (33), outside which the scheme has poor stability properties [30]; is written as a function of alone on that account. The optimal coefficient of (40) is then obtained by minimizing the maximum of over the interval of step sizes determined during burn-in, searching over values of lying between the minimum-error and Velocity Verlet values recorded in Table 5.
A.4 The Extended Hamiltonian for the Partial Momentum Update
Because is generally non-quadratic in the momentum, the rotation (15) no longer preserves the modified density and the momentum update must therefore be corrected by a Metropolis test with respect to
which restores invariance of the joint density in and corresponds to the momentum update test of Algorithm 3. Under the standard Hamiltonian, is already invariant under the rotation, so GHMC needs no analogous test.
[Acknowledgments] The authors would like to thank the Basque Center for Applied Mathematics (BCAM), particularly the Modeling & Simulation in Life and Materials Sciences group, for its stimulating research environment and support. We are especially grateful to Elena Akhmatskaya, Tijana Radivojević, Mario Fernández-Pendás, Martín Parga Pazos, Lorenzo Nagar, and Leonardo Gavira Balmacz for their valuable discussions and insights that helped shape the perspective of this survey.
References
[1] O. Abril-Pla, V. Andreani, C. Carroll, L. Dong, C. J. Fonnesbeck, M. Kochurov, R. Kumar, J. Lao, C. C. Luhmann, O. A. Martin, M. Osthege, R. Vieira, T. Wiecki, and R. Zinkov (2023) PyMC: a modern, and comprehensive probabilistic programming framework in Python. PeerJ Computer Science 9, pp. e1516. Cited by: §12.
[2] M. Agarwal, D. Vats, and V. Elvira (2022) A principled stopping rule for importance sampling. Electronic Journal of Statistics 16 (2), pp. 5570–5590. Cited by: Fig 7, §9.3.2.
[3] M. Agarwal and D. Vats (2022) Globally-centered autocovariances in MCMC. Journal of Computational and Graphical Statistics 31 (3), pp. 629–638. Cited by: §10.1.
[4] E. Akhmatskaya, M. Fernández-Pendás, T. Radivojević, and J. M. Sanz-Serna (2017) Adaptive splitting integrators for enhancing sampling efficiency of modified Hamiltonian Monte Carlo methods in molecular simulation. Langmuir 33 (42), pp. 11530–11542. Cited by: §5.3, §7.2, Fig 6, §8.4, Table 6.
[5] E. Akhmatskaya, L. Nagar, J. A. Carrillo, L. Gavira Balmacz, H. Inouzhe, M. Parga Pazos, and M. X. Rodríguez Álvarez (2026) Adaptive tuning of Hamiltonian Monte Carlo methods. Applied Mathematical Modelling 157, pp. 116892. Cited by: §1.1, §11.3, §12, §13.2, §4.3, Fig 6, §8.1, §8.4, §8.4, §8.4, §8.4, §8.5, Table 6, §9.4.
[6] E. Akhmatskaya and S. Reich (2008) GSHMC: an efficient method for molecular simulation. Journal of Computational Physics 227 (10), pp. 4934–4954. Cited by: §1.1, Fig 3, §5.2.
[7] M. P. Allen and D. J. Tildesley (2017) Computer simulation of liquids. 2nd edition, Oxford University Press. Cited by: Table 3.
[8] M. Alsefri, M. Sudell, M. García-Fiñana, and R. Kolamunnage-Dona (2020) Bayesian joint modelling of longitudinal and time to event data: a methodological review. BMC Medical Research Methodology 20 (94). Cited by: §11.3.
[9] C. Andrieu and J. Thoms (2008) A tutorial on adaptive MCMC. Statistics and Computing 18 (4), pp. 343–373. Cited by: §8.1.
[10] A. Beskos, N. Pillai, G. Roberts, J. M. Sanz-Serna, and A. Stuart (2013) Optimal tuning of the hybrid Monte Carlo algorithm. Bernoulli 19 (5A), pp. 1501–1534. Cited by: §1, §2.2, Table 2, §8.1.
[11] M. Betancourt, S. Byrne, S. Livingstone, and M. Girolami (2017) The geometric foundations of Hamiltonian Monte Carlo. Bernoulli 23 (4A), pp. 2257–2298. Cited by: §3.2.
[12] M. Betancourt and M. Girolami (2015) Hamiltonian Monte Carlo for hierarchical models. In Current Trends in Bayesian Methodology with Applications, S. K. Upadhyay, U. Singh, D. K. Dey, and A. Loganathan (Eds.), pp. 79–101. Cited by: Fig 1, §1, §11.1, §2.3, Remark 6.1.
[13] M. Betancourt (2013) A general metric for Riemannian manifold Hamiltonian Monte Carlo. In Geometric Science of Information (GSI 2013), Lecture Notes in Computer Science, Vol. 8085, pp. 327–334. Cited by: Fig 3, §6.1, Table 4.
[14] M. Betancourt (2015) The fundamental incompatibility of scalable Hamiltonian Monte Carlo and naive data subsampling. In Proceedings of the 32nd International Conference on Machine Learning (ICML), pp. 533–540. Cited by: §13.1, §6.3.
[15] M. Betancourt (2016) Diagnosing suboptimal cotangent disintegrations in Hamiltonian Monte Carlo. arXiv preprint arXiv:1604.00695. Cited by: §1, §3.4, §9.2, §9.2, Table 8, Table 8.
[16] M. Betancourt (2017) A conceptual introduction to Hamiltonian Monte Carlo. arXiv preprint arXiv:1701.02434. Cited by: §10.2, §2.2, §3.4, Table 6, §9.2, Table 8, Table 8.
[17] S. Blanes, F. Casas, and J. M. Sanz-Serna (2014) Numerical integrators for the Hybrid Monte Carlo method. SIAM Journal on Scientific Computing 36 (4), pp. A1556–A1580. Cited by: §1.1, Fig 3, §7.2, §7.2, §7.3, §7.4, §7.4.
[18] N. Bou-Rabee, B. Carpenter, and M. Marsden (2026) GIST: Gibbs self-tuning for locally adaptive Hamiltonian Monte Carlo. Statistics Surveys 20, pp. 135–179. Cited by: §1.1, §10.2, §13.2, §8.2, Table 6.
[19] N. Bou-Rabee and J. M. Sanz-Serna (2017) Randomized Hamiltonian Monte Carlo. The Annals of Applied Probability 27 (4), pp. 2159–2194. Cited by: §8.2.
[20] N. Bou-Rabee and J. M. Sanz-Serna (2018) Geometric integrators and the Hamiltonian Monte Carlo method. Acta Numerica 27, pp. 113–206. Cited by: §7.2.
[21] S. L. Brilleman, M. J. Crowther, M. Moreno-Betancur, J. Buros Novik, and R. Wolfe (2018) Joint longitudinal and time-to-event models via Stan. In Proceedings of StanCon 2018, Note: stan_jm in rstanarm External Links: Document Cited by: §11.3, §12.
[22] S. P. Brooks and A. Gelman (1998) General methods for monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics 7 (4), pp. 434–455. Cited by: §9.1.
[23] A. Brown (2025) A non-asymptotic error analysis for parallel Monte Carlo estimation from many short Markov chains. Statistics and Computing 35 (6), pp. 217. Cited by: §10.1.
[24] M. A. Brubaker, M. Salzmann, and R. Urtasun (2012) A family of MCMC methods on implicitly defined manifolds. In Proceedings of the 15th International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 161–172. Cited by: §6.2.
[25] S. Byrne and M. Girolami (2013) Geodesic Monte Carlo on embedded manifolds. Scandinavian Journal of Statistics 40 (4), pp. 825–845. Cited by: §6.2.
[26] A. Cabezas, A. Corenflos, J. Lao, R. Louf, et al. (2024) BlackJAX: composable Bayesian inference in JAX. arXiv preprint arXiv:2402.10797. Cited by: §12.
[27] B. Calderhead (2014) A general construction for parallelizing Metropolis–Hastings algorithms. Proceedings of the National Academy of Sciences 111 (49), pp. 17408–17413. Cited by: §10.2.
[28] M. P. Calvo, D. Sanz-Alonso, and J. M. Sanz-Serna (2021) HMC: avoiding rejections by not using leapfrog and some results on the acceptance rate. Journal of Computational Physics 437, pp. 110333. Cited by: Remark 5.2.
[29] C. M. Campos and J. M. Sanz-Serna (2015) Extra chance generalized hybrid Monte Carlo. Journal of Computational Physics 281, pp. 365–374. Cited by: Remark 5.2.
[30] C. M. Campos and J. M. Sanz-Serna (2017) Palindromic 3-stage splitting integrators, a roadmap. Journal of Computational Physics 346, pp. 340–355. Cited by: §A.3, §7.2.
[31] B. Carpenter, A. Gelman, M. D. Hoffman, D. Lee, B. Goodrich, M. Betancourt, M. Brubaker, J. Guo, P. Li, and A. Riddell (2017) Stan: a probabilistic programming language. Journal of Statistical Software 76 (1), pp. 1–32. Cited by: §12.
[32] T. Chen, E. Fox, and C. Guestrin (2014) Stochastic gradient Hamiltonian Monte Carlo. In Proceedings of the 31st International Conference on Machine Learning (ICML), pp. 1683–1691. Cited by: §6.3, Table 4.
[33] A. D. Cobb, A. G. Baydin, A. Markham, and S. J. Roberts (2019) Introducing an explicit symplectic integration scheme for Riemannian manifold Hamiltonian Monte Carlo. arXiv preprint arXiv:1910.06243. Cited by: §13.1, §6.1.
[34] J. V. Dillon, I. Langmore, D. Tran, E. Brevdo, S. Vasudevan, D. Moore, B. Patton, A. Alemi, M. D. Hoffman, and R. A. Saurous (2017) TensorFlow Distributions. arXiv preprint arXiv:1711.10604. Cited by: §12.
[35] S. Duane, A. D. Kennedy, B. J. Pendleton, and D. Roweth (1987) Hybrid monte carlo. Physics Letters B 195 (2), pp. 216–222. Cited by: §1, §3.1, Table 3.
[36] A. B. Duncan, T. Lelièvre, and G. A. Pavliotis (2016) Variance reduction using nonreversible Langevin samplers. Journal of Statistical Physics 163 (3), pp. 457–491. Cited by: §4.1.
[37] V. Elvira, L. Martino, and C. P. Robert (2022) Rethinking the effective sample size. International Statistical Review 90 (3), pp. 525–550. Cited by: §1.1, Fig 7, §9.3.2, §9.3.2.
[38] Y. Fang, Y. Cao, and R. D. Skeel (2022) Quasi-reliable estimates of effective sample size. IMA Journal of Numerical Analysis 42 (1), pp. 680–697. Cited by: §13.2.
[39] M. Fernández-de-Retana, A. Almeida, and E. Akhmatskaya (2025) PyHaiCS: a Python library for Hamiltonian Markov chain Monte Carlo in computational statistics. Note: Software package Cited by: §10.5, §12.
[40] M. Fernández-Pendás, E. Akhmatskaya, and J. M. Sanz-Serna (2016) Adaptive multi-stage integrators for optimal energy conservation in molecular simulations. Journal of Computational Physics 327, pp. 434–449. Cited by: Fig 6, §8.4, Table 6.
[41] J. M. Flegal and G. L. Jones (2010) Batch means and spectral variance estimators in Markov chain Monte Carlo. The Annals of Statistics 38 (2), pp. 1034–1070. Cited by: §9.3.1.
[42] A. Gelman, J. B. Carlin, H. S. Stern, D. B. Dunson, A. Vehtari, and D. B. Rubin (2013) Bayesian data analysis. 3rd edition, Chapman and Hall/CRC. Cited by: §1, §2.1.
[43] A. Gelman and D. B. Rubin (1992) Inference from iterative simulation using multiple sequences. Statistical Science 7 (4), pp. 457–472. Cited by: §9.1.
[44] C. J. Geyer (1992) Practical Markov chain Monte Carlo. Statistical Science 7 (4), pp. 473–483. Cited by: §1.1, Fig 7, §9.3.1.
[45] M. Girolami and B. Calderhead (2011) Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 73 (2), pp. 123–214. Cited by: §1.1, Fig 3, §6.1, Table 4.
[46] N. E. Glatt-Holtz, A. J. Holbrook, J. A. Krometis, and C. F. Mondaini (2024) Parallel MCMC algorithms: theoretical foundations, algorithm design, case studies. Transactions of Mathematics and Its Applications 8 (2), pp. tnae004. Cited by: §10.2.
[47] N. E. Glatt-Holtz, A. J. Holbrook, J. A. Krometis, and C. F. Mondaini (2026) Mad props: parallelism in Markov chain Monte Carlo through the lens of the infinite proposal limit. arXiv preprint arXiv:2605.21899. Cited by: §10.2.
[48] P. W. Glynn and C. Rhee (2014) Exact estimation for Markov chain equilibrium expectations. Journal of Applied Probability 51 (A), pp. 377–389. Cited by: §10.1.
[49] M. I. Gorinova, D. Moore, and M. D. Hoffman (2020) Automatic reparameterisation of probabilistic programs. In Proceedings of the 37th International Conference on Machine Learning (ICML), pp. 3648–3657. Cited by: §11.1, §11.1, §11.4, §13.1.
[50] M. M. Graham and A. J. Storkey (2017) Continuously tempered Hamiltonian Monte Carlo. In Proceedings of the 33rd Conference on Uncertainty in Artificial Intelligence (UAI), Cited by: §13.1.
[51] S. Grazzi and G. Zanella (2026) Parallel computations for Metropolis Markov chains with Picard maps. Biometrika 113 (2), pp. asag022. Cited by: §10.3, Table 9, §13.2.
[52] E. Hairer, C. Lubich, and G. Wanner (2006) Geometric numerical integration: structure-preserving algorithms for ordinary differential equations. 2nd edition, Springer, Berlin. Cited by: §1.1, §3.2, §5.1, §6.1, §7.2.
[53] W. K. Hastings (1970) Monte carlo sampling methods using markov chains and their applications. Biometrika 57 (1), pp. 97–109. Cited by: §2.2.
[54] J. Heng and P. E. Jacob (2019) Unbiased Hamiltonian Monte Carlo with couplings. Biometrika 106 (2), pp. 287–302. Cited by: §10.1.
[55] M. D. Hoffman and A. Gelman (2014) The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research 15 (1), pp. 1593–1623. Cited by: §1.1, §10.2, §8.1, §8.2, Table 6, Table 6.
[56] M. D. Hoffman, A. Radul, and P. Sountsov (2021) An adaptive-MCMC scheme for setting trajectory lengths in Hamiltonian Monte Carlo. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics (AISTATS), Proceedings of Machine Learning Research, Vol. 130, pp. 3907–3915. Cited by: §1.1, §10.5, §8.2, Table 6.
[57] M. D. Hoffman, P. Sountsov, J. V. Dillon, I. Langmore, D. Tran, and S. Vasudevan (2019) NeuTra-lizing bad geometry in Hamiltonian Monte Carlo using neural transport. arXiv preprint arXiv:1903.03704. Cited by: §13.1, §6.3, Table 4, §8.3.
[58] M. D. Hoffman and P. Sountsov (2022) Tuning-free generalized Hamiltonian Monte Carlo. In Proceedings of the 25th International Conference on Artificial Intelligence and Statistics (AISTATS), Proceedings of Machine Learning Research, Vol. 151, pp. 7799–7813. Cited by: §10.5, Remark 4.1, §8.4.
[59] A. J. Holbrook, P. Lemey, G. Baele, S. Dellicour, D. Brockmann, A. Rambaut, and M. A. Suchard (2021) Massive parallelization boosts big Bayesian multidimensional scaling. Journal of Computational and Graphical Statistics 30 (1), pp. 11–24. Cited by: §10.3.
[60] A. J. Holbrook (2023) A quantum parallel Markov chain Monte Carlo. Journal of Computational and Graphical Statistics 32 (4), pp. 1402–1415. Cited by: §10.4.
[61] A. M. Horowitz (1991) A generalized guided Monte Carlo algorithm. Physics Letters B 268 (2), pp. 247–252. Cited by: §1.1, §4.1, Table 3, Table 3.
[62] J. A. Izaguirre and S. S. Hampton (2004) Shadow hybrid Monte Carlo: an efficient propagator in phase space of macromolecules. Journal of Computational Physics 200 (2), pp. 581–604. Cited by: §1.1, Fig 3, §5.2.
[63] P. E. Jacob, J. O’Leary, and Y. F. Atchadé (2020) Unbiased Markov chain Monte Carlo methods with couplings. Journal of the Royal Statistical Society: Series B 82 (3), pp. 543–600. Cited by: §10.1.
[64] A. D. Kennedy and B. Pendleton (2001) Cost of the generalised hybrid Monte Carlo algorithm for free field theory. Nuclear Physics B 607 (3), pp. 456–510. Cited by: §1.1, §4.1, Table 3, Table 4.
[65] L. Kish (1965) Survey sampling. John Wiley & Sons, New York. Cited by: §9.3.2.
[66] A. Kong (1992) A note on importance sampling using standardized weights. Technical report Technical Report 348, Department of Statistics, University of Chicago. Cited by: §1.1, Fig 7, §9.3.2.
[67] R. Kumar, C. Carroll, A. Hartikainen, and O. Martin (2019) ArviZ a unified library for exploratory analysis of Bayesian models in Python. Journal of Open Source Software 4 (33), pp. 1143. Cited by: §12.
[68] S. Lan, V. Stathopoulos, B. Shahbaba, and M. Girolami (2015) Markov chain Monte Carlo from Lagrangian dynamics. Journal of Computational and Graphical Statistics 24 (2), pp. 357–378. Cited by: §13.1, Fig 3, §6.1, Table 4.
[69] S. Lan, J. Streets, and B. Shahbaba (2014) Wormhole Hamiltonian Monte Carlo. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 1953–1959. Cited by: §13.1.
[70] J. Lao, C. Suter, I. Langmore, C. Chimisov, A. Saxena, P. Sountsov, D. Moore, R. A. Saurous, M. D. Hoffman, and J. V. Dillon (2020) tfp.mcmc: modern Markov chain Monte Carlo tools built for modern hardware. arXiv preprint arXiv:2002.01184. Cited by: §12.
[71] D. Layden, G. Mazzola, R. V. Mishmash, M. Motta, P. Wocjan, J. Kim, and S. Sheldon (2023) Quantum-enhanced Markov chain Monte Carlo. Nature 619, pp. 282–287. Cited by: §10.4.
[72] B. Leimkuhler and S. Reich (2004) Simulating hamiltonian dynamics. Cambridge University Press. Cited by: §3.2, §6.1.
[73] D. Levy, M. D. Hoffman, and J. Sohl-Dickstein (2018) Generalizing Hamiltonian Monte Carlo with neural networks. In International Conference on Learning Representations (ICLR), Cited by: §6.3.
[74] C. Lin, K. Chen, P. Lemey, M. A. Suchard, A. J. Holbrook, and M. Hsieh (2025) Quantum speedups for multiproposal MCMC. Bayesian Analysis. Note: Advance publication External Links: Document Cited by: §10.4.
[75] X. Lu, V. Perrone, L. Hasenclever, Y. W. Teh, and S. J. Vollmer (2017) Relativistic Monte Carlo. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1236–1245. Cited by: Remark 3.1, Fig 3, §6.2, Table 4.
[76] C. C. Margossian and A. Gelman (2026) For how many iterations should we run Markov chain Monte Carlo?. In Handbook of Markov Chain Monte Carlo, R. V. Craiu, D. Vats, G. L. Jones, S. Brooks, A. Gelman, and X. Meng (Eds.), pp. 110–131. Cited by: §10.1, §13.2.
[77] C. C. Margossian, M. D. Hoffman, P. Sountsov, L. Riou-Durand, A. Vehtari, and A. Gelman (2025) Nested : assessing the convergence of Markov chain Monte Carlo when running many short chains. Bayesian Analysis 20 (4), pp. 1587–1614. Cited by: §10.1, §13.2, §9.1, Table 8.
[78] C. C. Margossian, A. Vehtari, D. Simpson, and R. Agrawal (2020) Hamiltonian Monte Carlo using an adjoint-differentiated Laplace approximation: Bayesian inference for latent Gaussian models and beyond. Advances in Neural Information Processing Systems (NeurIPS) 33, pp. 9086–9097. Cited by: §11.2.
[79] L. Martino, V. Elvira, and F. Louzada (2017) Effective sample size for importance sampling based on discrepancy measures. Signal Processing 131, pp. 386–401. Cited by: §1.1, Fig 7, §9.3.2.
[80] R. I. McLachlan (1995) On the numerical integration of ordinary differential equations by symmetric composition methods. SIAM Journal on Scientific Computing 16 (1), pp. 151–168. Cited by: §7.2, §7.3.
[81] N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller, and E. Teller (1953) Equation of state calculations by fast computing machines. The Journal of Chemical Physics 21 (6), pp. 1087–1092. Cited by: §2.2.
[82] C. Modi, A. Barnett, and B. Carpenter (2024) Delayed rejection Hamiltonian Monte Carlo for sampling multiscale distributions. Bayesian Analysis 19 (3), pp. 815–842. Cited by: Remark 4.1, Remark 5.2.
[83] C. Modi (2024) ATLAS: adapting trajectory lengths and step-size for Hamiltonian Monte Carlo. arXiv preprint arXiv:2410.21587. Cited by: §8.2, Table 6.
[84] L. Nagar, M. Fernández-Pendás, J. M. Sanz-Serna, and E. Akhmatskaya (2024) Adaptive multi-stage integration schemes for Hamiltonian Monte Carlo. Journal of Computational Physics 502, pp. 112800. Cited by: §1.1, §1.1, §A, Fig 3, §7.2, §7.2, §7.4, Remark 7.1, Fig 6, §8.1, §8.4, §8.4, §8.4, Table 6, §9.4.
[85] L. Nagar (2025) Optimising performance of Hamiltonian Monte Carlo (HMC) in molecular simulation and computational statistics. Ph.D. Thesis, University of the Basque Country (UPV/EHU). Cited by: §4.3, §8.4.
[86] R. M. Neal (2003) Slice sampling. The Annals of Statistics 31 (3), pp. 705–767. Cited by: Fig 1, §1.
[87] R. M. Neal (2011) MCMC using Hamiltonian dynamics. In Handbook of Markov Chain Monte Carlo, S. Brooks, A. Gelman, G. L. Jones, and X. Meng (Eds.), pp. 113–162. Cited by: §1, §3.1, §3.2, §3.2, §3.3, §3.3, §3.4, §3.4, Table 3, Table 4.
[88] R. M. Neal (2020) Non-reversibly updating a uniform value for Metropolis accept/reject decisions. arXiv preprint arXiv:2001.11950. Cited by: Remark 4.1.
[89] W. Neiswanger, C. Wang, and E. P. Xing (2014) Asymptotically exact, embarrassingly parallel MCMC. In Proceedings of the 30th Conference on Uncertainty in Artificial Intelligence, pp. 623–632. Cited by: §10.3.
[90] C. Nemeth and C. Sherlock (2018) Merging MCMC subposteriors through Gaussian-process approximations. Bayesian Analysis 13 (2), pp. 507–530. Cited by: §10.3.
[91] Y. Nesterov (2009) Primal-dual subgradient methods for convex problems. Mathematical Programming 120 (1), pp. 221–259. Cited by: §8.1.
[92] A. Nishimura, D. B. Dunson, and J. Lu (2020) Discontinuous Hamiltonian Monte Carlo for discrete parameters and discontinuous likelihoods. Biometrika 107 (2), pp. 365–380. Cited by: §13.1, Remark 3.1, §6.2.
[93] A. Orfi and D. Sels (2024) Bounding the speedup of the quantum-enhanced Markov-chain Monte Carlo algorithm. Physical Review A 110, pp. 052414. Cited by: §10.4.
[94] M. Ottobre (2016) Markov chain Monte Carlo and irreversibility. Reports on Mathematical Physics 77 (3), pp. 267–292. Cited by: §4.1.
[95] A. B. Owen (2013) Monte carlo theory, methods and examples. Stanford University. Cited by: §2.1.
[96] O. Papaspiliopoulos, G. O. Roberts, and M. Sköld (2007) A general framework for the parametrization of hierarchical models. Statistical Science 22 (1), pp. 59–73. Cited by: Fig 1, §11.1, §11.1, §2.3.
[97] M. Parga Pazos (2024) Tackling the development of hormone therapy resistance in breast cancer through mathematical modelling. Ph.D. Thesis, University of the Basque Country (UPV/EHU). Cited by: §5.3, §8.4, Table 6.
[98] D. Phan, N. Pradhan, and M. Jankowiak (2019) Composable effects for flexible and accelerated probabilistic programming in NumPyro. arXiv preprint arXiv:1912.11554. Cited by: §12.
[99] M. Plummer, N. Best, K. Cowles, and K. Vines (2006) CODA: convergence diagnosis and output analysis for MCMC. R News 6 (1), pp. 7–11. Cited by: Fig 7, §9.3.1.
[100] C. Predescu, R. A. Lippert, M. P. Eastwood, D. Ierardi, H. Xu, M. Ø. Jensen, K. J. Bowers, J. Gullingsrud, C. A. Rendleman, R. O. Dror, and D. E. Shaw (2012) Computationally efficient molecular dynamics integrators with improved sampling accuracy. Molecular Physics 110 (9-10), pp. 967–983. Cited by: §7.3.
[101] T. Radivojević and E. Akhmatskaya (2020) Modified Hamiltonian Monte Carlo for Bayesian inference. Statistics and Computing 30 (2), pp. 377–404. Cited by: §1.1, §A, Fig 3, §5.2, Table 4, §9.3.3.
[102] T. Radivojević, M. Fernández-Pendás, J. M. Sanz-Serna, and E. Akhmatskaya (2018) Multi-stage splitting integrators for sampling with modified Hamiltonian Monte Carlo methods. Journal of Computational Physics 373, pp. 900–916. Cited by: §1.1, §A.1, §A.2, §A, §5.3, §7.2, §7.2, §7.5, Remark 7.1.
[103] T. Radivojević (2016) Enhancing sampling in computational statistics using modified hamiltonians. Ph.D. Thesis, University of the Basque Country (UPV/EHU). Cited by: §12, §5.2, §9.3.3.
[104] L. Riou-Durand and J. Vogrinc (2022) Metropolis adjusted Langevin trajectories: a robust alternative to Hamiltonian Monte Carlo. arXiv preprint arXiv:2202.13230. Cited by: Remark 4.1.
[105] D. Rizopoulos, P. Miranda Afonso, and G. Papageorgiou (2024) JMbayes2: extended joint models for longitudinal and time-to-event data. CRAN. Note: R package version 0.5-2 Cited by: §12.
[106] D. Rizopoulos (2012) Joint models for longitudinal and time-to-event data: with applications in R. Chapman and Hall/CRC. Cited by: §1.2, §11.3.
[107] C. P. Robert and G. Casella (1999) Monte carlo statistical methods. Springer, New York. Cited by: §2.1.
[108] G. O. Roberts and J. S. Rosenthal (1998) Optimal scaling of discrete approximations to Langevin diffusions. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 60 (1), pp. 255–268. Cited by: §2.2, Table 2, Table 3.
[109] G. O. Roberts and J. S. Rosenthal (2001) Optimal scaling for various Metropolis–Hastings algorithms. Statistical Science 16 (4), pp. 351–367. Cited by: §2.2, Table 2.
[110] G. O. Roberts and R. L. Tweedie (1996) Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli 2 (4), pp. 341–363. Cited by: §2.2.
[111] J. Robnik, R. Cohn-Gordon, and U. Seljak (2025) Metropolis adjusted microcanonical Hamiltonian Monte Carlo. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 38, pp. 17098–17128. Cited by: §10.5, §6.2.
[112] J. Robnik, G. B. De Luca, E. Silverstein, and U. Seljak (2023) Microcanonical Hamiltonian Monte Carlo. Journal of Machine Learning Research 24 (311), pp. 1–34. Cited by: §10.5, §6.2, Table 4.
[113] J. Robnik and U. Seljak (2024) Fluctuation without dissipation: microcanonical Langevin Monte Carlo. In Proceedings of the 6th Symposium on Advances in Approximate Bayesian Inference, Proceedings of Machine Learning Research, Vol. 253, pp. 111–126. Cited by: §6.2, Table 4.
[114] P. J. Rossky, J. D. Doll, and H. L. Friedman (1978) Brownian dynamics as smart Monte Carlo simulation. The Journal of Chemical Physics 69 (10), pp. 4628–4633. Cited by: §2.2, Table 3.
[115] H. Rue, S. Martino, and N. Chopin (2009) Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 71 (2), pp. 319–392. Cited by: §11.2.
[116] D. Rustand, J. van Niekerk, E. T. Krainski, H. Rue, and C. Proust-Lima (2024) Fast and flexible inference for joint models of multivariate longitudinal and survival data using integrated nested Laplace approximations. Biostatistics 25 (2), pp. 429–448. Cited by: §11.2.
[117] J. M. Sanz-Serna and M. P. Calvo (1994) Numerical hamiltonian problems. Chapman and Hall, London. Cited by: §5.1.
[118] S. L. Scott, A. W. Blocker, F. V. Bonassi, H. A. Chipman, E. I. George, and R. E. McCulloch (2016) Bayes and big data: the consensus Monte Carlo algorithm. International Journal of Management Science and Engineering Management 11 (2), pp. 78–88. Cited by: §10.3.
[119] C. Sherlock, S. Urbas, and M. Ludkin (2023) The apogee to apogee path sampler. Journal of Computational and Graphical Statistics 32 (4), pp. 1436–1446. Cited by: §8.2, Table 6.
[120] R. D. Skeel and D. J. Hardy (2001) Practical construction of modified Hamiltonians. SIAM Journal on Scientific Computing 23 (4), pp. 1172–1188. Cited by: §5.1.
[121] A. Sokal (1997) Monte Carlo methods in statistical mechanics: foundations and new algorithms. In Functional Integration: Basics and Applications, pp. 131–192. Cited by: §9.3.1, §9.4.
[122] S. Talts, M. Betancourt, D. Simpson, A. Vehtari, and A. Gelman (2018) Validating Bayesian inference algorithms with simulation-based calibration. arXiv preprint arXiv:1804.06788. Cited by: §11.4, §9.1, Table 8.
[123] M. Tao (2016) Explicit symplectic approximation of nonseparable Hamiltonians: algorithm and long time performance. Physical Review E 94 (4), pp. 043303. Cited by: §13.1, §6.1, Table 4.
[124] L. Tierney (1994) Markov chains for exploring posterior distributions. The Annals of Statistics 22 (4), pp. 1701–1728. Cited by: §2.2.
[125] H. Tjelmeland (2004) Using all Metropolis–Hastings proposals to estimate mean values. Preprint in Statistics Technical Report 4/2004, Norwegian University of Science and Technology. Cited by: §10.2.
[126] N. Tripuraneni, M. Rowland, Z. Ghahramani, and R. Turner (2017) Magnetic Hamiltonian Monte Carlo. In Proceedings of the 34th International Conference on Machine Learning (ICML), pp. 3453–3461. Cited by: Fig 3, §6.2, Table 4.
[127] D. Vats, J. M. Flegal, and G. L. Jones (2019) Multivariate output analysis for Markov chain Monte Carlo. Biometrika 106 (2), pp. 321–337. Cited by: §13.2, Fig 7, §9.3.1.
[128] A. Vehtari, A. Gelman, D. Simpson, B. Carpenter, and P. Bürkner (2021) Rank-normalization, folding, and localization: an improved for assessing convergence of MCMC (with discussion). Bayesian Analysis 16 (2), pp. 667–718. Cited by: §11.4, §12, §9.1, Table 8.
[129] L. Verlet (1967) Computer “experiments” on classical fluids. I. thermodynamical properties of Lennard-Jones molecules. Physical Review 159 (1), pp. 98–103. Cited by: §7.1.
[130] Z. Wang, S. Mohamed, and N. de Freitas (2013) Adaptive Hamiltonian and Riemann manifold Monte Carlo. In Proceedings of the 30th International Conference on Machine Learning (ICML), Proceedings of Machine Learning Research, Vol. 28, pp. 1462–1470. Cited by: Table 6.
[131] G. Zanella and G. Roberts (2021) Multilevel linear models, Gibbs samplers and multigrid decompositions (with discussion). Bayesian Analysis 16 (4), pp. 1309–1391. Cited by: §2.3.
[132] L. Zhang, B. Carpenter, A. Gelman, and A. Vehtari (2022) Pathfinder: parallel quasi-Newton variational inference. Journal of Machine Learning Research 23 (306), pp. 1–49. Cited by: §10.1, §13.2.
[133] H. Zhou, B. Wang, and M. Sugiyama (2025) The adaptive complexity of parallelized log-concave sampling. In Proceedings of the 13th International Conference on Learning Representations (ICLR), Cited by: §10.3, §13.2.