KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
Single_step_sampler< Model > Class Template Reference

#include <sample_sampler.h>

Inheritance diagram for Single_step_sampler< Model >:
Abstract_sampler< Model >

Public Types

typedef Abstract_sampler< Model > Parent
 
typedef Abstract_sampler
< Model >::Step 
Step
 
- Public Types inherited from Abstract_sampler< Model >
typedef Sampler_step< Model >::Type Step
 
typedef Model Model_type
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((BaseModel< Model >))
 
 Single_step_sampler (const Step &step, const Model &initial_state, double initial_log_target)
 Constructs an object of this type from a MH step. More...
 
- Public Member Functions inherited from Abstract_sampler< Model >
 Abstract_sampler (const Model &initial_state, double initial_log_target)
 
 BOOST_CONCEPT_ASSERT ((BaseModel< Model >))
 
virtual void run (int num_iterations)
 Runs the sampler. This function runs the sampler for the indicated number of iterations. At each iteration it chooses a sampler step using choose_step() and invokes it using its operator(). The best model is saved and returned. More...
 
Model & current_state ()
 
const Model & current_state () const
 
double current_log_target () const
 
template<class Recorder >
void add_recorder (Recorder r)
 
template<class Recorder >
void add_recorder (Recorder *r)
 
template<class Callback >
void add_record_callback (Callback cb)
 
template<class Recorder >
const Recorder & get_recorder (size_t i) const
 
void if_accept (const Callback &cb)
 
void if_reject (const Callback &cb)
 
void on_accept (const Callback &cb)
 
void on_reject (const Callback &cb)
 

Protected Member Functions

virtual const Stepchoose_step () const
 Returns the step given in the constructor. More...
 

Detailed Description

template<typename Model>
class Single_step_sampler< Model >

Template Parameters
ModelThe model type. Must comply with BaseModel concept.

A sampler with a single step type. In other words, the choose_step member function simply returns the same step.

Member Typedef Documentation

template<typename Model >
typedef Abstract_sampler<Model> Single_step_sampler< Model >::Parent
template<typename Model >
typedef Abstract_sampler<Model>::Step Single_step_sampler< Model >::Step

Constructor & Destructor Documentation

template<typename Model >
Single_step_sampler< Model >::Single_step_sampler ( const Step step,
const Model &  initial_state,
double  initial_log_target 
)
inline

Constructs an object of this type from a MH step.

Parameters
stepThe Basic_mh_step that this sampler will run.
initial_stateThe model to intialize the sample with
initial_log_targetThe log probability of the initial_state model under the target distribution.

Member Function Documentation

template<typename Model >
Single_step_sampler< Model >::BOOST_CONCEPT_ASSERT ( (BaseModel< Model >)  )
template<typename Model >
virtual const Step& Single_step_sampler< Model >::choose_step ( ) const
inlineprotectedvirtual

Returns the step given in the constructor.

Implements Abstract_sampler< Model >.


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