# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.random.rng.multivariate.mcmc.hybrid

## Class ErgodicHybridMCMC

• java.lang.Object
• com.numericalmethod.suanshu.stats.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 and 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
Modifier and Type Method and Description
double[] nextVector()
Get the next random vector.
void seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### 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 dt
deltaT - the function that gives the next value of dt given the current value
hybridMCMC - 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 range
b - the upper bound of the range
uniform - the random long generator to be used
hybridMCMC - the underlying AbstractHybridMCMC
• ### Method Detail

• #### nextVector

public double[] nextVector()
Description copied from interface: RandomVectorGenerator
Get the next random vector.
Specified by:
nextVector in interface RandomVectorGenerator
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.
Specified by:
seed in interface Seedable
Parameters:
seeds - the seeds