Public Member Functions |
| | chainBundle (Random &random) |
| | ~chainBundle () |
|
int | nChains () |
| | Return number of chains.
|
|
T * | chain (const int i) |
| | Return pointer to ith chain.
|
|
double | stepSize () |
| | Return current stepsize.
|
|
double | nLeapfrog () |
| | Return current number of leapfrog steps.
|
|
double | ESS (int i) |
| | Return the ith effective sample size.
|
|
double | minESS () |
| | Return the smallest effective sample size.
|
|
vector< VectorXd > & | samples () |
| | Return accumulated samples.
|
| void | setVerbosity (const unsigned int v) |
|
void | setNumSubsample (const int n) |
| | Set number of HMC transitions per sample.
|
|
void | setNumLeapfrog (const int n) |
| | Set number of leapfrog steps.
|
|
void | setWindowSize (const int n) |
| | Set reject/accept window size.
|
|
void | setStepSize (const double s) |
| | Set stepsize.
|
|
void | setStepSizeJitter (const double j) |
| | Set valid step size jitter, as a fraction of the stepsize.
|
|
void | setStepSizeJerk (const double j) |
| | Set valid step size jerk, as a fraction of the stepsize.
|
|
void | setProbStepSizeJerk (const double p) |
| | Set valid step size jitter, as a fraction of the stepsize.
|
|
void | setTemperAlpha (const double a) |
| | Set HMC tempering parameter.
|
|
void | setAdaptIntTime (double t) |
| | Set target integration time for stepsize adaptation.
|
|
void | setAdaptTargetAccept (double a) |
| | Set target accept rate for stepsize adaptation.
|
|
void | setAdaptMaxLeapfrog (int n) |
| | Set maximum number of leapfrog steps for stepsize adaptation.
|
|
void | storeSamples (const bool store=true) |
| | Set sample storage flag.
|
|
void | setMaxLagDisplay (int n) |
| | Set maximum displayed lag.
|
|
void | setMaxLagCalc (int n) |
| | Set maximum calculated lag.
|
|
void | useExternalMoments (VectorXd &mean, VectorXd &var) |
|
void | addChain (T *object) |
| | Add a new chain to the bundle.
|
| void | evolve (T *chain, const double epsilon) |
| void | verboseEvolve (T *chain, const double epsilon) |
|
void | engageAdaptation () |
| | Engage dual-averaging stepsize adaptation.
|
|
void | disengageAdaptation () |
| | Disengage dual-averaging stepsize adaptation.
|
| void | initAdaptation () |
| void | updateAdaptation (double metropolisProb) |
|
void | transition () |
| | Transition all chains currently in the bundle.
|
| void | transition (int i) |
| bool | transition (T *chain) |
| void | saveTrajectory (std::ofstream &outputFile, const int i=0) |
| void | checkIntError (const int i, const int N, const int f=1) |
| void | seed (const double min, const double max) |
| void | seed (const int i, const double min, const double max) |
| void | burn (const int nBurn=100, const int nCheck=100, const double minR=1.1, const bool verbose=true) |
|
void | clearSamples () |
| | Clear all stored samples.
|
| void | computeSummaryStats (const int b, const bool verbose=true, std::ofstream *outputFile=NULL) |
Protected Member Functions |
|
virtual bool | fConstraint (T *chain) |
| | Does the chain satisfy all defined constraints?
|
|
virtual const VectorXd & | fNormal (T *chain) |
| | Return the normal to the constraint surface.
|
| double | fLogSumExp (double a, double b) |
Protected Attributes |
|
bool | mStoreSamples |
| | Sample storage flag.
|
|
bool | mAdaptStepSize |
| | Step-size adaptation flag.
|
|
bool | mRefStats |
| | Reference statistics flag.
|
|
bool | mChar |
| | Burn in completion flag.
|
|
bool | mConstraint |
| | Constraint satisfaction flag.
|
|
bool | mUseExternalMoments |
| | External moments for autocorrelation calculation flag.
|
|
unsigned int | mVerbosity |
| | Verbosity level.
|
|
Random | mRandom |
| | Mersenne twistor pseudo-random number generator.
|
|
int | mNumSubsample |
| | Number of HMC transitions per sample.
|
|
int | mNumLeapfrog |
| | Number of leapfrog steps.
|
|
int | mWindowSize |
| | Size of reject/accept windows.
|
|
double | mStepSize |
| | Nominal leapfrog stepsize.
|
|
double | mStepSizeJitter |
| | Stepsize jitter, as fraction of current stepsize.
|
|
double | mStepSizeJerk |
| | Stepsize jerk, as fraction of current stepsize.
|
|
double | mProbStepSizeJerk |
| | Probability of a stepsize jerk instead of the usual jitter.
|
|
int | mNumFixedPoint |
| | Number of fixed point iterations for implicit leapfrog updates.
|
|
double | mTemperAlpha |
| | Tempering parameter.
|
|
double | mAdaptTargetAccept |
| | Stepsize adaptation target accept probability.
|
|
double | mAdaptIntTime |
| | Stepsize adaptation target integration time.
|
|
int | mAdaptMaxLeapfrog |
| | Stepsize adaptation maximum number of leapfrog steps.
|
|
double | mAdaptMu |
| | Stepsize adaptation mu.
|
|
double | mAdaptLogEpsBar |
| | Stepsize adaptation epsilon average.
|
|
double | mAdaptHBar |
| | Stepsize adaptation H average.
|
|
double | mAdaptCounter |
| | Stepsize adaptation counter.
|
|
double | mAdaptGamma |
| | Stepsize adaptation shrinkage parameter.
|
|
double | mAdaptKappa |
| | Stepsize adaptation decay parameter.
|
|
double | mAdaptT0 |
| | Stepsize adaptation initialization parameter.
|
|
int | mNumSamples |
| | Total number of computed samples.
|
|
vector< VectorXd > | mSamples |
| | Stored samples.
|
|
vector< double > | mSampleE |
| | Stored sample potential energies.
|
|
int | mMaxLagDisplay |
| | Maximum lag to display/save.
|
|
int | mMaxLagCalc |
| | Maximum lag used in calculation of autocorrelations.
|
|
VectorXd | mESS |
| | Vector of effective sample sizes, computed in computeSummaryStats()
|
|
VectorXd * | mExternalMean |
| | External mean for calculating the autocorrelations.
|
|
VectorXd * | mExternalVar |
| | External variance for calculating the autocorrelations.
|
|
vector< T * > | mChains |
| | Vector of baseChain pointers.
|
|
vector< T * >::iterator | mIt |
| | Vector iterator.
|
template<typename T>
class chainBundle< T >
- Author:
- Michael Betancourt
Container for an ensemble of Markov chains, including functionality for constrainted Hamiltonian Monte Carlo transitions, convergence diagnostics, and sample analysis.
See chainBundle::evolve() for details on the symplectic integrator used for the Hamiltonian evolution.
- Examples:
-
examples/main.cpp.