Fleet  0.0.9
Inference in the LOT
Public Member Functions | Public Attributes | List of all members
MCMCChain< HYP > Class Template Reference

#include <MCMCChain.h>

Collaboration diagram for MCMCChain< HYP >:
Collaboration graph
[legend]

Public Member Functions

 MCMCChain (HYP &h0, typename HYP::data_t *d)
 
 MCMCChain (HYP &&h0, typename HYP::data_t *d)
 
 MCMCChain (const MCMCChain &m)
 
 MCMCChain (MCMCChain &&m)
 
virtual ~MCMCChain ()
 
void set_data (typename HYP::data_t *d, bool recompute_posterior=true)
 Set this data. More...
 
HYP & getCurrent ()
 
void runOnCurrent ()
 
const HYP & getMax ()
 
generator< HYP & > run (Control ctl)
 Run MCMC according to the control parameters passed in. NOTE: ctl cannot be passed by reference. More...
 
void run ()
 
double acceptance_ratio ()
 
double at_temperature (double t)
 

Public Attributes

HYP current
 
OrderedLock current_mutex
 
HYP::data_t * data
 
double maxval
 
unsigned long samples
 
unsigned long proposals
 
unsigned long acceptances
 
unsigned long steps_since_improvement
 
std::atomic< double > temperature
 
FiniteHistory< bool > history
 

Detailed Description

template<typename HYP>
class MCMCChain< HYP >

Author
Steven Piantadosi
Date
25/10/21

Constructor & Destructor Documentation

◆ MCMCChain() [1/4]

template<typename HYP >
MCMCChain< HYP >::MCMCChain ( HYP &  h0,
typename HYP::data_t *  d 
)
inline

◆ MCMCChain() [2/4]

template<typename HYP >
MCMCChain< HYP >::MCMCChain ( HYP &&  h0,
typename HYP::data_t *  d 
)
inline

◆ MCMCChain() [3/4]

template<typename HYP >
MCMCChain< HYP >::MCMCChain ( const MCMCChain< HYP > &  m)
inline

◆ MCMCChain() [4/4]

template<typename HYP >
MCMCChain< HYP >::MCMCChain ( MCMCChain< HYP > &&  m)
inline

◆ ~MCMCChain()

template<typename HYP >
virtual MCMCChain< HYP >::~MCMCChain ( )
inlinevirtual

Member Function Documentation

◆ acceptance_ratio()

template<typename HYP >
double MCMCChain< HYP >::acceptance_ratio ( )
inline

Get my acceptance ratio

Returns

◆ at_temperature()

template<typename HYP >
double MCMCChain< HYP >::at_temperature ( double  t)
inline

Return my current posterior at a given temperature t

Parameters
t
Returns

◆ getCurrent()

template<typename HYP >
HYP& MCMCChain< HYP >::getCurrent ( )
inline

get a reference to the current value

Returns

◆ getMax()

template<typename HYP >
const HYP& MCMCChain< HYP >::getMax ( )
inline

◆ run() [1/2]

template<typename HYP >
generator<HYP&> MCMCChain< HYP >::run ( Control  ctl)
inline

Run MCMC according to the control parameters passed in. NOTE: ctl cannot be passed by reference.

Parameters
ctl

◆ run() [2/2]

template<typename HYP >
void MCMCChain< HYP >::run ( )
inline

Run forever

◆ runOnCurrent()

template<typename HYP >
void MCMCChain< HYP >::runOnCurrent ( )
inline

This is called by the constructor to compute the posterior. NOTE it does not callback

◆ set_data()

template<typename HYP >
void MCMCChain< HYP >::set_data ( typename HYP::data_t *  d,
bool  recompute_posterior = true 
)
inline

Set this data.

Parameters
d- what data to set
recompute_posterior- should I recompute the posterior on current?

Member Data Documentation

◆ acceptances

template<typename HYP >
unsigned long MCMCChain< HYP >::acceptances

◆ current

template<typename HYP >
HYP MCMCChain< HYP >::current

◆ current_mutex

template<typename HYP >
OrderedLock MCMCChain< HYP >::current_mutex
mutable

◆ data

template<typename HYP >
HYP::data_t* MCMCChain< HYP >::data

◆ history

template<typename HYP >
FiniteHistory<bool> MCMCChain< HYP >::history

◆ maxval

template<typename HYP >
double MCMCChain< HYP >::maxval

◆ proposals

template<typename HYP >
unsigned long MCMCChain< HYP >::proposals

◆ samples

template<typename HYP >
unsigned long MCMCChain< HYP >::samples

◆ steps_since_improvement

template<typename HYP >
unsigned long MCMCChain< HYP >::steps_since_improvement

◆ temperature

template<typename HYP >
std::atomic<double> MCMCChain< HYP >::temperature

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