BayesOpt
|
Markov Chain Monte Carlo sampler. More...
#include <mcmc_sampler.hpp>
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 ©) | |
Private Attributes | |
boost::scoped_ptr< RBOptimizableWrapper > | obj |
McmcAlgorithms | mAlg |
size_t | mDims |
size_t | nBurnOut |
size_t | nSamples |
bool | mStepOut |
vectord | mSigma |
vecOfvec | mParticles |
randEngine & | mtRandom |
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.
Definition at line 50 of file mcmc_sampler.hpp.
bayesopt::MCMCSampler::MCMCSampler | ( | RBOptimizable * | rbo, |
size_t | dim, | ||
randEngine & | eng | ||
) |
Constructor (Note: default constructor is private)
rbo | point to RBOptimizable type of object with the PDF to sample from. IMPORTANT: We assume that the evaluation of rbo is the NEGATIVE LOG PDF. |
dim | number of input dimensions |
eng | random number generation engine (boost) |
Definition at line 28 of file mcmc_sampler.cpp.
References bayesopt::SLICE_MCMC.
void bayesopt::MCMCSampler::run | ( | vectord & | Xnext | ) |
Compute the set of particles according to the target PDF.
Xnext | input: initial point of the Markov Chain, output: last point of the Markov Chain |
Definition at line 131 of file mcmc_sampler.cpp.
|
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.