Class AbstractHybridMCMC

java.lang.Object
dev.nm.stat.random.rng.multivariate.mcmc.metropolis.AbstractMetropolis
dev.nm.stat.random.rng.multivariate.mcmc.hybrid.AbstractHybridMCMC
All Implemented Interfaces:
RandomVectorGenerator, Seedable
Direct Known Subclasses:
HybridMCMC, MultipointHybridMCMC

public abstract class AbstractHybridMCMC extends AbstractMetropolis
Hybrid Monte Carlo, or Hamiltonian Monte Carlo, is a method that combines the traditional Metropolis algorithm, with molecular dynamics simulation. The idea is to make use of the equations from classical mechanics, to guide our choice of proposed state. At each step we generate a random momentum vector, where each component is drawn from a Gaussian distribution. Considering the target density as the potential energy field of the system and the current state as the initial position of the molecules, we perform a molecular dynamics simulation (using the LeapFrogging algorithm) for the given time period. The final position of the molecules is taken as the next proposed state. The acceptance-rejection decision is then done like as in the classical Metropolis algorithm.
  • Field Details

    • dt

      protected double dt
  • Constructor Details

    • AbstractHybridMCMC

      public AbstractHybridMCMC(Vector initialState, RandomNumberGenerator rng)
      Constructs a new instance with the given parameters.
      Parameters:
      initialState - the initial state of the algorithm
      rng - a random number generator
  • Method Details

    • setDeltaT

      public final void setDeltaT(double dt)
      Sets the value of dt that will be used in the subsequent iterations. This is useful for varying the time step size between iterations.
      Parameters:
      dt - the value of dt
    • dUdx

      public static RealVectorFunction dUdx(RealVectorFunction dLogF)
      Gets the derivative of the potential function, given the derivative of the log density.
      Parameters:
      dLogF - the derivative of the log density, density logF = -U(x)
      Returns:
      the derivative of the potential function
    • H

      public static double H(LeapFrogging.DynamicsState state, RealScalarFunction logF, Vector m)
      Evaluates a system's total energy at a given state.
      Parameters:
      state - the state of the system
      logF - the log-density function, -U(x)
      m - the mass of the components
      Returns:
      the total energy, H(x, p)
    • k

      public static double k(Vector p, Vector m)
      Evaluates the standard kinetic energy, k = p^2 / 2m.
      Parameters:
      p -
      m -
      Returns:
      k