Class mcmc_stepper_base (o2scl)

O2scl : Class List

template<class func_t, class data_t, class vec_t>
class mcmc_stepper_base

Stepper for o2scl::mcmc_para_base [pure virtual].

Subclassed by o2scl::mcmc_stepper_rw< func_t, data_t, ubvector >, o2scl::mcmc_stepper_hmc< func_t, data_t, vec_t, grad_t, vec_bool_t >, o2scl::mcmc_stepper_mh< func_t, data_t, vec_t, mat_t, prop_t >, o2scl::mcmc_stepper_rw< func_t, data_t, vec_t >

Public Functions

inline mcmc_stepper_base()
inline virtual void write_params(o2scl_hdf::hdf_file &hf)

Write stepper parameters to the HDF5 file.

virtual const char *step_type() = 0

Stepper type.

inline void check_bounds(size_t i_thread, size_t n_params, vec_t &v, vec_t &low, vec_t &high, int &func_ret, int verbose)

Check that v is between low and high.

This function checks that the parameters are within limits. If they are not, then func_ret is set to mcmc_skip. Otherwise, func_ret is unchanged. If verbose is greater than or equal to 3, then a out-of-bounds warning is printed to the screen. Generally, if a point is out of bounds, this just means that the MCMC algorithm will reject this point as if it had a very small likelihood.

virtual void step(size_t i_thread, size_t n_params, func_t &f, vec_t &current, vec_t &next, double w_current, double &w_next, vec_t &low, vec_t &high, int &func_ret, bool &accept, data_t &dat, rng<> &r, int verbose) = 0

Construct a step.

This function constructs next and w_next, the next point and log weight in parameter space. The objective function f is then evaluated at the new point, the return value is placed in func_ret, and the step acceptance or rejection is stored in accept.

inline virtual ~mcmc_stepper_base()

Protected Static Attributes

static const int mcmc_done = -10

Integer to indicate completion.

static const int mcmc_skip = -20

Integer to indicate rejection.