MRS  1.0
A C++ Class Library for Statistical Set Processing
subpavings::MCMCGRAuto Class Reference

Type for objects capable of doing MCMC with some automatic convergence/burn-in testing rule using Gelman-Rubin heuristics. More...

+ Inheritance diagram for subpavings::MCMCGRAuto:

List of all members.

Classes

class  Diagnostic
 An abstract type to calculate Gelman-Rubin convergence diagnostics for an MCMC process. More...

Public Types

enum  SAMPLING_TYPE { NORMAL = -1, DISCRIMINATING = 0, CAUTIOUS = 1 }
 An enum to control the behaviour of the sampler if the criteria for the Gelman-Rubin convergence diagnostic ceases to be met when it has previously been met. More...

Public Member Functions

virtual size_t getMaxFlagThreshold () const =0
 Get the maximum flag threshold that makes sense for this.
virtual double getLastRunTime () const =0
 Get the time taken, in seconds, for the last successful run.
virtual size_t getFirstBurninTime () const =0
 Get the state at which burnin is first reached.
Get a PiecewiseConstantFunction from MCMC with some

automatic convergence/burnin testing rule using Gelman-Rubin heuristics.

The PiecewiseConstantFunction returned is the average over samplesNeeded samples from the chains started at the histograms in histPtrsVec.

Samples are collected from all the chains: at each sampling point (as determined by the automatically determined burnin point and the thinout) each chain is sampled in order, until samplesNeeded samples have been collected.

Throws a std::invalid_argument exception if the number of histograms in histPtrsVec is less than 2.

Throws a std::logic_error if any of the histograms in histPtrsVec has an illegal state with respect to minPoints, ie if any of the cherries should not have been split.

Throws a std::runtime_error if the process fails. This can happen if there there is no legal change of state available to a histogram in histPtrsVec (eg starting state is a single leaf root node which cannot be split) or if the required number of samples is not collected before the process is aborted because the maximum number of loops maxLoops has been reached.

Each use of this to doMCMCAuto should initiate an MCMC process guided by a unique sequence of random numbers but also so that the first use of this will always be associated with the same sequence, the second use with its own sequence, etc etc, irrespective of how many prngs are generated from each separate sequence (ie how many loops are called for in each use of doMCMCAuto).

virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int runID, SAMPLING_TYPE samplingType=NORMAL) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int samplesMonitored, int thinout, size_t minPoints, int runID, SAMPLING_TYPE samplingType=NORMAL) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int runID, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int runID, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int runID, const std::string &scalarsFileName) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int samplesMonitored, int thinout, size_t minPoints, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &h, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int rhatFlagCounterThreshold, int runID, SAMPLING_TYPE samplingType=NORMAL) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &h, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int rhatFlagCounterThreshold, int runID, SAMPLING_TYPE samplingType=NORMAL) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int rhatFlagCounterThreshold, int runID, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int rhatFlagCounterThreshold, int runID, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int rhatFlagCounterThreshold, int runID, const std::string &scalarsFileName) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, real minVol, int rhatFlagCounterThreshold, int runID, const std::string &scalarsFileName) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int rhatFlagCounterThreshold, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType=NORMAL) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, size_t minPoints, int rhatFlagCounterThreshold, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const
virtual PiecewiseConstantFunction doMCMCGRAuto (std::vector< subpavings::AdaptiveHistogram * > &histPtrsVec, int maxLoops, int samplesNeeded, int thinout, int samplesMonitored, size_t minPoints, int rhatFlagCounterThreshold, int runID, const std::string &scalarsFileName, SAMPLING_TYPE samplingType, LOGGING_LEVEL logging, LOGGING_LEVEL loggingInChangeStates) const

Detailed Description

Type for objects capable of doing MCMC with some automatic convergence/burn-in testing rule using Gelman-Rubin heuristics.


Member Enumeration Documentation

An enum to control the behaviour of the sampler if the criteria for the Gelman-Rubin convergence diagnostic ceases to be met when it has previously been met.

  • NORMAL: just burn in once and then sample from there, even if we move out of the tolerance band afterwards.
  • DISCRIMINATING: sample only when we are in the tolerance band, but if we move out, keep all samples and just wait to come back in again, then sample again.
  • CAUTIOUS: throw away all existing samples if we move out of the tolerance band, wait to come back in, and sample from scratch again.
{NORMAL = -1, DISCRIMINATING = 0, CAUTIOUS = 1}

Member Function Documentation

virtual size_t subpavings::MCMCGRAuto::getFirstBurninTime ( ) const [pure virtual]

Get the state at which burnin is first reached.

If the sampling type is CAUTIOUS, this will be the state at which the last successful attempt at burnin was reached.

Implemented in subpavings::MCMCGRAutoNew.

virtual double subpavings::MCMCGRAuto::getLastRunTime ( ) const [pure virtual]

Get the time taken, in seconds, for the last successful run.

If the last run was not successful, the value returned by this method will not necessarily record the time taken for that last run.

Implemented in subpavings::MCMCGRAutoNew.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends