Class mcmc_para_emu (o2scl)

O2scl : Class List

template<class func_t, class fill_t, class data_t, class vec_t = ubvector>
class mcmc_para_emu : public o2scl::mcmc_para_cli<std::function<int(size_t, const ubvector&, double&, data_t&)>, fill_t, data_t, ubvector>

MCMC with an emulator.

Note

OpenMP threading probably doesn’t work yet.

Constructor and destructor

std::vector<std::shared_ptr<interpm_base<ubvector, o2scl::const_matrix_view_table<>, o2scl::matrix_view_table<>>>> emu

List of shared pointers to the interpolators.

inline mcmc_para_emu()
inline virtual ~mcmc_para_emu()
inline int point_wrapper(size_t it, size_t np, const vec_t &p, double &log_wgt, data_t &dat)

Wrapper to the point function which uses the emulator.

inline virtual void outside_parallel()

Update the emulator outside the parallel region.

inline virtual int add_line(const vec_t &pars, double log_weight, size_t walker_ix, int func_ret, bool mcmc_accept, data_t &dat, size_t i_thread, fill_t &fill)

The function to add a line to the table.

This function computes the full likelihood in case of an acceptance.

inline void emu_train()

Train the emulator.

inline int mcmc_emu(size_t n_params_local, vec_t &low, vec_t &high, std::vector<func_t> &func, std::vector<fill_t> &fill, std::vector<data_t> &data)

The new MCMC function.

Public Types

typedef std::function<int(size_t, const vec_t&, double&, data_t&)> internal_point_t
typedef mcmc_para_cli<std::function<int(size_t, const vec_t&, double&, data_t&)>, fill_t, data_t, vec_t> parent_t

Public Members

std::string emu_file

File containing the training data for the emulator.

size_t max_train_size

Maximum size of training table (default 1000)

size_t n_retrain

Number of iterations before retraining (default 1000)

A value of 0 skips the emulator completely and runs only the user-specified function.

int show_emu

If true, show the emulator accuracy (default 0)

bool test_emu

If true, test the emulator with 10 percent of the data (default false)

Protected Attributes

o2scl::table_units emu_table

Table containing training data for the emulator.

o2scl::table_units emu_init

Table containing initial emulator training file.

size_t n_rows_emu_init

The number of rows in the original training data file.

std::vector<func_t> *func_ptr

Pointer to the user-specified function array.

size_t n_params_child

The number of parameters.

size_t last_retrain_sum

Sum at last retraining.