Class HybridMCMC
- java.lang.Object
-
- dev.nm.stat.random.rng.multivariate.mcmc.metropolis.AbstractMetropolis
-
- dev.nm.stat.random.rng.multivariate.mcmc.hybrid.AbstractHybridMCMC
-
- dev.nm.stat.random.rng.multivariate.mcmc.hybrid.HybridMCMC
-
- All Implemented Interfaces:
RandomVectorGenerator
,Seedable
public class HybridMCMC extends AbstractHybridMCMC
This class implements a hybrid MCMC algorithm. Consider using ErgodicHybridMCMC if you are experiencing components that deviate little at each step.
-
-
Field Summary
-
Fields inherited from class dev.nm.stat.random.rng.multivariate.mcmc.hybrid.AbstractHybridMCMC
dt
-
-
Constructor Summary
Constructors Constructor Description HybridMCMC(RealScalarFunction logF, RealVectorFunction dLogF, Vector m, double dt, int L, Vector initialState, RandomLongGenerator rlg)
Constructs a new instance with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isProposalAccepted(Vector currentState, Vector proposedState)
Decides whether the given proposed state should be accepted, or whether the system should remain in it's current state.protected Vector
nextProposedState(Vector currentState)
Proposes a next state for the system.-
Methods inherited from class dev.nm.stat.random.rng.multivariate.mcmc.hybrid.AbstractHybridMCMC
dUdx, H, k, setDeltaT
-
Methods inherited from class dev.nm.stat.random.rng.multivariate.mcmc.metropolis.AbstractMetropolis
acceptanceRate, nextVector, seed
-
-
-
-
Constructor Detail
-
HybridMCMC
public HybridMCMC(RealScalarFunction logF, RealVectorFunction dLogF, Vector m, double dt, int L, Vector initialState, RandomLongGenerator rlg)
Constructs a new instance with the given parameters.- Parameters:
logF
- the log of the unnormalized target density from which we wish to sampledLogF
- the derivative of the log target density for use by the LeapFrogging algorithm. You may choose a function that differs from the actual derivative of the log target density (i.e. that of a tempered version of the target density), in order to guide the leap-frogging algorithmm
- the mass of each component in the dynamics simulation. A lower mass for a given component will result in greater change over the simulated timedt
- the amount by which we advance time at each dynamics simulation stepL
- the number of dynamics simulation stepsinitialState
- the initial state of the algorithmrlg
- the random long generator to be used
-
-
Method Detail
-
nextProposedState
protected Vector nextProposedState(Vector currentState)
Description copied from class:AbstractMetropolis
Proposes a next state for the system.- Specified by:
nextProposedState
in classAbstractMetropolis
- Parameters:
currentState
- the current state of the system- Returns:
- the proposed next state
-
isProposalAccepted
protected boolean isProposalAccepted(Vector currentState, Vector proposedState)
Description copied from class:AbstractMetropolis
Decides whether the given proposed state should be accepted, or whether the system should remain in it's current state.- Specified by:
isProposalAccepted
in classAbstractMetropolis
- Parameters:
currentState
- the current state of the systemproposedState
- the proposed next state of the system- Returns:
- whether the system should accept the proposed next state
-
-