Class ErgodicHybridMCMC
java.lang.Object
dev.nm.stat.random.rng.multivariate.mcmc.hybrid.ErgodicHybridMCMC
- All Implemented Interfaces:
RandomVectorGenerator
,Seedable
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
ConstructorsConstructorDescriptionErgodicHybridMCMC
(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
Modifier and TypeMethodDescriptiondouble[]
Gets the next random vector.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
ErgodicHybridMCMC
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 Details
-
nextVector
public double[] nextVector()Description copied from interface:RandomVectorGenerator
Gets the next random vector.- Specified by:
nextVector
in interfaceRandomVectorGenerator
- Returns:
- the next random vector
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-