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

This class is instantiated with one or more MCMCGRAuto::Diagnostic diagnostics objects. Each one calculates its own Gelman-Rubin values and determines whether its own tolerance criteria is met. The MCMCGRAutoNew object organises the MCMC process and determines whether some overall burn-in criteria across all the diagnostics it is using is satisfied (eg, whether some threshold number of diagnostic criteria rhatFlagCounterThreshold has been met). If this overall burn-in criteria is satisfied, this object samples from the chains. When sampling is completed this object returns the sample average. More...

+ Inheritance diagram for subpavings::MCMCGRAutoNew:
+ Collaboration diagram for subpavings::MCMCGRAutoNew:

List of all members.

Public Member Functions

 MCMCGRAutoNew (const std::vector< MCMCGRAuto::Diagnostic * > &diagPtrs, unsigned long int seed=1234)
 Constructor.
size_t getMaxFlagThreshold () const
 Get the maximum flag threshold that makes sense for this.
double getLastRunTime () const
 Get the time taken, in seconds, for the last successful run.
size_t getFirstBurninTime () const
 Get the state at which burnin is first reached.

Detailed Description

This class is instantiated with one or more MCMCGRAuto::Diagnostic diagnostics objects. Each one calculates its own Gelman-Rubin values and determines whether its own tolerance criteria is met. The MCMCGRAutoNew object organises the MCMC process and determines whether some overall burn-in criteria across all the diagnostics it is using is satisfied (eg, whether some threshold number of diagnostic criteria rhatFlagCounterThreshold has been met). If this overall burn-in criteria is satisfied, this object samples from the chains. When sampling is completed this object returns the sample average.

If rhatFlagCounterThreshold is not specified as an argument to to doMCMCGRAuto(), the default value is the number of diagnostic criteria, ie all have to be 'true' for convergence to be deemed to have taken place.

Objects of this type use a LogCatalan prior and a UniformSSMProposal (stay-split-merge base chain) with probability of staying in the same state $ \sigma = 1.0E-6 $ for the MCMC routine.


Constructor & Destructor Documentation

MCMCGRAutoNew::MCMCGRAutoNew ( const std::vector< MCMCGRAuto::Diagnostic * > &  diagPtrs,
unsigned long int  seed = 1234 
) [explicit]

Constructor.

The constructor uses seed to initialise a prng to generate random seeds to be used for the doMCMCGRAuto process.

The number of post-burnin samples monitored using the convergence diagnostics if NORMAL sampling is used (i.e., burnin once) is set to some small default value. This just means that output from the diagnostics that can be used to make trace plots extends a little way past the point where burnin is diagnosed.

Parameters:
diagObjThe Gelman-Rubin convergence diagnostic object.
seedseed to use for a pseudo random number generator (defaults to 1234).
Precondition:
t > 0.0.
  : diagObjPtrs(diagPtrs), rgsl(NULL), time(0.0), burntinReachedState(0)
  
{
  
  try {
    
    rgsl = gsl_rng_alloc (gsl_rng_mt19937);
          
    gsl_rng_set(rgsl, seed);
  }
  catch (...) {
    try {
      if (NULL != rgsl) {
        gsl_rng_free(rgsl);
        rgsl = NULL;
      } 
    }
    catch (...) {} // catch and swallow
    throw;
  }
}

Member Function Documentation

size_t MCMCGRAutoNew::getFirstBurninTime ( ) const [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.

Implements subpavings::MCMCGRAuto.

{
  return burntinReachedState;
}
double MCMCGRAutoNew::getLastRunTime ( ) const [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.

Implements subpavings::MCMCGRAuto.

{
  return time;
}

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