Base class for an MCMC simulation.
|
Public Member Functions |
|
virtual | ~Simulation () |
| | Force runtime binding of inherited destructor.
|
|
virtual void | Reinitialize (MHWidth *width, MixturePrior *p) |
| | Reinitialize Metropolis Hastings proposal width and Prior.
|
|
void | OneStep () |
| | Take one MCMC step.
|
|
Converge * | getConverge () const |
| | Convergence method.
|
|
bool | Convergence () |
| | Uses provided convergence method to indicate completion.
|
|
int | BurnIn () |
| | Indicate state index beyond which chain is converged.
|
|
void | NewConvergence (int m, Ensemble *d, string id) |
| | Construct new instance of convergence for new level.
|
|
State | Prior () |
| | Generate a state from current prior.
|
|
virtual double | Likelihood (State &, int indx) |
| | Determine likelihood for current state.
|
|
double | PriorValue (State &) |
| | Determine prior value for current state.
|
|
virtual State | GetState () |
| | Return current state.
|
| virtual void | PrintStepDiagnostic () |
| | Print diagnostic information at end of step.
|
|
virtual void | PrintStateDiagnostic () |
| | Print diagnostic information about each state Intended to be overridden to provide information that is simulation specific.
|
|
virtual double | GetValue () |
| | Return current posterior probability value.
|
|
virtual double | GetPrior () |
| | Return current prior value.
|
|
virtual double | GetLikelihood () |
| | Return current likelihood probability value.
|
|
void | SetThreshold (double v) |
| | Set per bin data threshold for rejecting a state as inconsistent.
|
|
void | SetUserLikelihood (LikelihoodFunction *fct) |
| | Set a user-defined likelihood function.
|
|
Simulation * | GetPreviousSimulation () |
| | Get prior simulation instance.
|
|
void | ResetFrontier () |
| | Reset current frontier to default.
|
|
void | SetPriorFrontier (Frontier *f) |
| | Set frontier for prior level.
|
|
int | GetMmax () |
| | Maximum number of mixture components.
|
|
int | GetMcur () |
| | Get the number of components in the fiducial chain.
|
|
int | GetNdim () |
| | Model dimension.
|
|
BaseDataTree * | GetDataTree () |
| | Get DataTree for this Simulation.
|
|
LikelihoodComputation * | GetLike () |
| | Get LikelihoodComputation for this Simulation.
|
|
MCAlgorithm * | GetMCA () |
| | Get Monte Carlo Algorithm for this Simulation.
|
|
MixturePrior * | GetMixturePrior () |
| | Get Prior for this Simulation.
|
|
MHWidth * | GetMHWidth () |
| | Get Metropolis-Hastings width for this Simulation.
|
|
Frontier * | currentFrontier () |
| | Get current frontier pointer.
|
|
Frontier * | priorFrontier () |
| | Get prior frontier pointer.
|
|
virtual void | AdditionalInfo () |
| | Print out simulation specific diagnostics.
|
|
void | DebugState (string s) |
| | Enable state debugging for examining multilevel likelihood ratios.
|
|
| | Simulation (int M, int Ndim, MHWidth *mhwidth, BaseDataTree *d, Model *m, Integration *i, Converge *c, MixturePrior *p, LikelihoodComputation *l, MCAlgorithm *mca, Simulation *last=NULL) |
| | Constructor: All subordinate "helper" classes are provided at instantiation.
|
| | Simulation (int M, int Ndim, BaseDataTree *d, Model *m, Integration *i, Converge *c, MixturePrior *p, LikelihoodComputation *l, MCAlgorithm *mca, Simulation *last=NULL) |
| | Constructor without a Metropolis-Hastings width (initial version).
|
|
|
bool | AccumConverge (double value, State &state) |
| | Accumulate states for testing convergence.
|
|
bool | AccumConverge (vector< double > &values, vector< State > &states) |
|
|
virtual void | ReportState (State &s) |
| | Print passed state in ascii with labels.
|
|
virtual void | ReportState () |
|
|
virtual void | LogState (string &logfile) |
| | Add state to log file.
|
|
virtual void | LogState (int level, int iterno, string &outfile) |
|
|
virtual void | NewState (int Mcur, vector< double > &w, vector< vector< double > > &p) |
| | Initialize new state.
|
|
virtual void | NewState (Chain &ch) |
|
virtual void | NewState (State &s) |
|
|
State | Mix_to_State (int Mcur, vector< double > &w, vector< vector< double > > &p) |
| | Utility functions.
|
|
void | State_to_Mix (int &Mcur, vector< double > &w, vector< vector< double > > &p, State &s) |
|
virtual void | PrintState () |
|
bool | Serial () |
|
bool | Parallel () |
Public Attributes |
| LikelihoodFunction * | LP |
| | Function to return the probability for a distribution of a particular type given the prediction and sample distribution.
|
Static Public Attributes |
|
static unsigned int | state_diag |
| | Number of states to accumulate before printing diagnostic messages.
|
|
static unsigned int | output_prec |
| | Output precision for logging state data.
|
Protected Member Functions |
|
virtual void | MCMethod () |
| | MCMC method to be defined by the implementing class.
|
|
void | print_bin_frequency (void) |
| | Print occupation numbers in each tile (for debugging).
|
|
double | BinnedLikeProb (vector< double > &z, SampleDistribution *sd, double norm, Tile *t, State *s) |
| | Use log Poisson probability to compute the joint probability for each bin given the data in the BinnedDistribution (passed as a SampleDistribution).
|
|
double | PointLikeProb (vector< double > &z, SampleDistribution *sd, double norm, Tile *t, State *s) |
| | Use log probabiilty for each point.
|
Protected Attributes |
|
bool | first_log |
| | True if no states have been logged.
|
|
int | M |
| | Number of components in the mixture.
|
|
int | Ndim |
| | Dimension of each mixture ocmponent.
|
|
MHWidth * | _mhwidth |
| | The Metropolis-Hastings width.
|
|
Simulation * | _last |
| | The last simulation.
|
|
BaseDataTree * | _dist |
| | The data.
|
|
Integration * | _intgr |
| | The integraton over the x-y area.
|
|
MixturePrior * | _prior |
| | The prior distribution.
|
|
Model * | _model |
| | The theoretical/hypothetical model.
|
|
Converge * | _conv |
| | The definition of the convergence algorithm.
|
|
LikelihoodComputation * | _likelihoodComputation |
| | The likelihood evaluation computation strategy.
|
|
MCAlgorithm * | _mca |
| | The Markov Chain algorithm.
|
|
Frontier * | _currentFrontier |
| | The current frontier in the DataTree.
|
|
Frontier * | _priorFrontier |
| | The previous frontier in the DataTree.
|
|
bool | internalLP |
| | Flags whether or not internal default likelhood functions or user a user-defined likelihood function is used.
|
| bool | serialLP |
| | Flags parallel or serial likelihood computation.
|
|
bool | state_not_initialized |
| | Is there a valid state?
|
|
int | nbad |
| | Tally rejected states.
|
|
int | ngood |
| | Tally good states.
|
|
double | threshval |
| | Default per bin trim (default: 0).
|
|
bool | debug_state |
| | State logging for debugging.
|
|
string | debug_tag |
| | File for debug output.
|
|
int | debug_cnt |
| | Counter for number of debug calls.
|
|
string | algoname |
| | Algorithm name.
|
|
| Chain | ch |
| | Chain state variables.
|
|
Chain * | chfid |
|
vector< Chain > | chains |
| | List of chains.
|
|
int | Mchains |
| | Number of chains.
|
Friends |
|
class | LikelihoodComputation |
|
class | MCAlgorithm |
|
class | MetropolisHastings |
|
class | ReversibleJump |
|
class | boost::serialization::access |
Base class for an MCMC simulation.
This simulation can be run; it simply invokes the MCMC algorithm for a single update step.