Obsidian
Probabilistic Geophysical Joint Inversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
stateline::mcmc::Sampler Class Reference

Represents a Markov Chain Monte Carlo sampler that returns samples from a distribution. More...

#include <mcmc.hpp>

Public Member Functions

 Sampler (const MCMCSettings &s, const DBSettings &d, uint stateDim, volatile bool &interrupted)
 Create a new sampler. More...
 
template<class AsyncPolicy , class PropFn >
void run (AsyncPolicy &policy, const std::vector< Eigen::VectorXd > &initialStates, PropFn &propFn, uint numSeconds)
 Run the sampler for a period of time. More...
 
ChainArray chains ()
 Get the MCMC chain array. More...
 
const ChainArraychains () const
 Get the MCMC chain array. More...
 

Detailed Description

Represents a Markov Chain Monte Carlo sampler that returns samples from a distribution.

Constructor & Destructor Documentation

stateline::mcmc::Sampler::Sampler ( const MCMCSettings s,
const DBSettings d,
uint  stateDim,
volatile bool &  interrupted 
)
inline

Create a new sampler.

Parameters
sSettings to tune various parameters of the MCMC.
dSettings for configuring the database for storing samples.
stateDimThe number of dimensions in each sample.
interruptedA flag used to monitor whether the sampler has been interrupted.

Member Function Documentation

ChainArray stateline::mcmc::Sampler::chains ( )
inline

Get the MCMC chain array.

Returns
A copy of the chain array.
const ChainArray& stateline::mcmc::Sampler::chains ( ) const
inline

Get the MCMC chain array.

Returns
A const reference to the chain array.
template<class AsyncPolicy , class PropFn >
void stateline::mcmc::Sampler::run ( AsyncPolicy &  policy,
const std::vector< Eigen::VectorXd > &  initialStates,
PropFn &  propFn,
uint  numSeconds 
)
inline

Run the sampler for a period of time.

Parameters
policyAsync policy to evaluate states.
initialStatesInitial chain states. Ignored if recovering.
propFnThe proposal function.
numSecondsThe number of seconds to run the MCMC for.

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