Hot answers tagged

23

Hamiltonian Monte Carlo performs well with continuous target distributions with "weird" shapes. It requires the target distribution to be differentiable as it basically uses the slope of the target distribution to know where to go. The perfect example is a banana shaped function. Here is a standard Metropolis Hastings in a Banana function: Acceptance rate ...


11

I believe the most up-to-date source on Hamiltonian Monte Carlo, its practical applications and comparison to other MCMC methods is this 2017-dated review paper by Betancourt: The ultimate challenge in estimating probabilistic expectations is quantifying the typical set of the target distribution, a set which concentrates near a complex surface in ...


9

One of the reasons why the original construction of Hamiltonian Monte Carlo can be tricky to understand is that it is more restrictive than necessary, if only to simplify the theoretical proofs. In particular, the negation of the momenta in the deterministic update is indeed practically irrelevant because of the full momenta resampling*. If we include it ...


8

$\mathrm{d}q$ is uniform across the entire space and that's the problem! Unfortunately as we consider higher-dimensional spaces out intuition of uniform starts failing us and we end up in conceptual difficulties like this. Yes, the volume of the neighborhood around any given point remains the same size as we increase the dimensionality of our space. But ...


8

It's not so much that we are after $\pi(E)$, it's just that if $\pi(E)$ and $\pi(E|q)$ are dissimilar then our exploration will be limited by our inability to explore all of the relevant energies. Consequently, in practice empirical estimates of $\pi(E)$ and $\pi(E|q)$ are useful for identifying any potential limitations of our exploration which is the ...


7

The deterministic Hamiltonian trajectories are useful only because they are consistent with the target distribution. In particular, trajectories with a typical energy project onto regions of high probability of the target distribution. If we could integrate Hamilton's equations exactly and construct explicit Hamiltonian trajectories then we would have a ...


6

One of the confusing things about concentration of measure is that we're trying to demonstrate deviations away from our naive, low-dimensional intuition. Here that is demonstrated in how the radial volume changes relative to a uniform distribution over radii. As we move away from a given point the shells of constant radial distance grow bigger and bigger, ...


4

The biggest problem with drawing from the prior is if a user is using a rather flat prior. For example, if a user is using a logistic regression model and they don't want the prior to have much of an effect on the posterior, they may choose to make the prior a normal distribution with a standard deviation of 100. Taking a draw from this prior will, with very ...


4

Objects declared in the transformed parameters block of a Stan program are: Unknown but are known given the values of the objects in the parameters block Saved in the output and hence should be of interest to the researcher Are usually the arguments to the log-likelihood function that is evaluated in the model block, although in hierarchical models the line ...


4

The proposal distribution for the original Hamiltonian Monte Carlo algorithm is just a delta function around the final point in the numerical trajectory with the momentum negated, $$K(z' | z) = \delta \, (z' - R(\Phi_{\epsilon, L}(z))), $$ where $z = (q, p)$ is a point on phase space, $\Phi_{\epsilon, L}(z)$ is the action of the numerical integrator, and $R$ ...


3

Hamiltonian Monte Carlo (HMC), originally called Hybrid Monte Carlo, is a form of Markov Chain Monte Carlo with a momentum term and corrections. The "Hamiltonian" refers to Hamiltonian mechanics. The use-case is stochastically (randomly) exploring high dimensions for numeric integration over a probability space. Contrast with MCMC Plain/vanilla Markov ...


3

It looks like you might be re-inventing Approximate Bayesian Computation (ABC). The core of ABC is to simulate many synthetic datasets and compare the synthetic data to the observed data based on some summary statistics. You can read Marin et al. (2012) for a review.


2

As mentioned in the comments by cwl, bjw and Sycorax, the following resources are useful (I can recommend them from my own experience as well): Statistical rethinking by R. McElreath has a short but very approachable introduction (and is a great book overall). Conceptual Introduction to Hamiltonian Monte Carlo by M. Betancourt goes into depth. Stan ...


2

The easiest way to understand why Langevin dynamics targets the "correct distribution" is to look at the corresponding Fokker-Planck equation. Let me be more precise. Let us assume that our target distribution has the following density: $\pi(x) = \frac1{Z} \exp(-U(x))$, where $x \in \mathbb{R}^d$, $U$ is often called the potential energy, and $Z$ is the ...


1

For the most basic version of HMC, the procedure is: using the leapfrog integrator, generate a trajectory $L$ steps long, which approximates Hamiltonian dynamics propose a move to the $L^{\text{th}}$ point on that trajectory accept or reject this proposed move using a Metropolis-Hastings correction. In the situation you describe, step 1 fails - or ...


1

If $K$ is a Markov kernel(with density $k$) with stationary distribution $P$ (with density $p$), then, if $(X_t)_t$ is a stationary Markov chain associated with $K$, \begin{align*}\mathbb E\left[\frac{p(X_{t+1})}{p(X_t)}\right] &=\int_{\mathfrak{X^2}} \frac{p(x_{t+1})}{p(x_t)} p(x_t)k(x_t,x_{t+1})\text{d}\lambda(x_t)\text{d}\lambda(x_{t+1}) \\ &= \...


1

The proposal distribution in Hamiltonian Monte Carlo does not have an explicit form in general. Instead, samples from it are defined operationally: first sample an initial velocity and then move the position using a number of leap-frog steps. The final position is a sample from the proposal distribution.


1

The following is a rough exposition of what the requirement for differentiability on the parameters means here. $U$ involves the log posterior up to an additive constant where $\theta$ are the model parameters. The requirement for differentiability is essentially that one can make a miniscule change to a parameter $\theta$ and this will return a small ...


1

Yes, it makes sense that all the parameters within a particular chain have high autocorrelation. A "stuck" chain is a Markov chain that hasn't reached the typical set and is not effectively making draws from the correct posterior distribution. When this happens, the tuning parameters are estimated to the region of the posterior that has been seen, which isn'...


1

This paper is likely relevant. Abstract: Hamiltonian Monte Carlo (HMC) is a successful approach for sampling from continuous densities. However, it has difficulty simulating Hamiltonian dynamics with non-smooth functions, leading to poor performance. This paper is motivated by the behavior of Hamiltonian dynamics in physical systems like optics. We ...


Only top voted, non community-wiki answers of a minimum length are eligible