Class ErgodicHybridMCMC
- java.lang.Object
-
- dev.nm.stat.random.rng.multivariate.mcmc.hybrid.ErgodicHybridMCMC
-
- All Implemented Interfaces:
RandomVectorGenerator
,Seedable
public class ErgodicHybridMCMC extends Object implements RandomVectorGenerator
A simple decorator which will randomly vary dt between each sample. At each step dt is uniformly chosen from a given range. This avoids the possibility that the chosen dt produces a trajectory that is periodic for L leapfrog steps, and hence returns to (or close to) the starting point at each iteration. In cases where there are a lot of interactions between the components, this should not be an issue, although even near periodicities can have a significant adverse effect on the performance of the algorithm.
-
-
Constructor Summary
Constructors Constructor Description ErgodicHybridMCMC(double a, double b, RandomLongGenerator uniform, AbstractHybridMCMC hybridMCMC)
Constructs a new instance where dt is uniformly drawn from a given range.ErgodicHybridMCMC(double dt0, UnivariateRealFunction deltaT, AbstractHybridMCMC hybridMCMC)
Constructs a new instance where dt is given as a function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
nextVector()
Gets the next random vector.void
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
ErgodicHybridMCMC
public ErgodicHybridMCMC(double dt0, UnivariateRealFunction deltaT, AbstractHybridMCMC hybridMCMC)
Constructs a new instance where dt is given as a function.- Parameters:
dt0
- the initial value for dtdeltaT
- the function that gives the next value of dt given the current valuehybridMCMC
- the underlying AbstractHybridMCMC
-
ErgodicHybridMCMC
public ErgodicHybridMCMC(double a, double b, RandomLongGenerator uniform, AbstractHybridMCMC hybridMCMC)
Constructs a new instance where dt is uniformly drawn from a given range.- Parameters:
a
- the lower bound of the rangeb
- the upper bound of the rangeuniform
- the random long generator to be usedhybridMCMC
- the underlying AbstractHybridMCMC
-
-
Method Detail
-
nextVector
public double[] nextVector()
Description copied from interface:RandomVectorGenerator
Gets the next random vector.- Specified by:
nextVector
in interfaceRandomVectorGenerator
- Returns:
- the next random vector
-
-