BayesOpt
bayesopt::MCMCSampler Class Reference

Markov Chain Monte Carlo sampler. More...

#include <mcmc_sampler.hpp>

+ Collaboration diagram for bayesopt::MCMCSampler:

Public Member Functions

 MCMCSampler (RBOptimizable *rbo, size_t dim, randEngine &eng)
 Constructor (Note: default constructor is private) More...
 
void setAlgorithm (McmcAlgorithms newAlg)
 Sets the sampling algorithm (slice, MH, etc.)
 
void setNParticles (size_t nParticles)
 Sets the number of particles that are stored.
 
void setNBurnOut (size_t nParticles)
 Usually, the initial samples of any MCMC method are biased and they are discarded. More...
 
void run (vectord &Xnext)
 Compute the set of particles according to the target PDF. More...
 
vectord getParticle (size_t i)
 
void printParticles ()
 

Private Member Functions

void randomJump (vectord &x)
 
void burnOut (vectord &x)
 
void sliceSample (vectord &x)
 
 MCMCSampler (MCMCSampler &copy)
 

Private Attributes

boost::scoped_ptr< RBOptimizableWrapperobj
 
McmcAlgorithms mAlg
 
size_t mDims
 
size_t nBurnOut
 
size_t nSamples
 
bool mStepOut
 
vectord mSigma
 
vecOfvec mParticles
 
randEngine & mtRandom
 

Detailed Description

Markov Chain Monte Carlo sampler.

It generates a set of particles that are distributed according to an arbitrary pdf. IMPORTANT: As it should be a replacement for the optimization (ML or MAP) estimation, it also assumes a NEGATIVE LOG PDF.

See also
NLOPT_Optimization

Definition at line 50 of file mcmc_sampler.hpp.

Constructor & Destructor Documentation

◆ MCMCSampler()

bayesopt::MCMCSampler::MCMCSampler ( RBOptimizable rbo,
size_t  dim,
randEngine &  eng 
)

Constructor (Note: default constructor is private)

Parameters
rbopoint to RBOptimizable type of object with the PDF to sample from. IMPORTANT: We assume that the evaluation of rbo is the NEGATIVE LOG PDF.
dimnumber of input dimensions
engrandom number generation engine (boost)

Definition at line 28 of file mcmc_sampler.cpp.

References bayesopt::SLICE_MCMC.

Member Function Documentation

◆ run()

void bayesopt::MCMCSampler::run ( vectord &  Xnext)

Compute the set of particles according to the target PDF.

Parameters
Xnextinput: initial point of the Markov Chain, output: last point of the Markov Chain

Definition at line 131 of file mcmc_sampler.cpp.

◆ setNBurnOut()

void bayesopt::MCMCSampler::setNBurnOut ( size_t  nParticles)
inline

Usually, the initial samples of any MCMC method are biased and they are discarded.

This phase is called the burnout. This method sets the number of particles to be discarded

Definition at line 115 of file mcmc_sampler.hpp.


The documentation for this class was generated from the following files: