25 #include <queso/Defines.h>
27 #ifdef QUESO_HAVE_HDF5
29 #ifndef QUESO_INFINITE_SAMPLER_H
30 #define QUESO_INFINITE_SAMPLER_H
33 #include <boost/scoped_ptr.hpp>
34 #include <boost/shared_ptr.hpp>
37 #include <queso/Environment.h>
38 #include <queso/InfiniteDimensionalMeasureBase.h>
39 #include <queso/InfiniteDimensionalLikelihoodBase.h>
40 #include <queso/InfiniteDimensionalMCMCSamplerOptions.h>
43 #include <gsl/gsl_rng.h>
57 class InfiniteDimensionalMCMCSampler
61 InfiniteDimensionalMCMCSampler(
62 const BaseEnvironment& env,
63 InfiniteDimensionalMeasureBase & prior,
64 InfiniteDimensionalLikelihoodBase & llhd,
65 InfiniteDimensionalMCMCSamplerOptions * ov);
68 ~InfiniteDimensionalMCMCSampler();
74 double llhd_val()
const;
80 double avg_acc_prob();
83 unsigned int iteration()
const;
86 boost::shared_ptr<InfiniteDimensionalMCMCSampler> clone_and_reset()
const;
90 unsigned int _iteration;
102 InfiniteDimensionalMeasureBase & prior;
106 InfiniteDimensionalLikelihoodBase & llhd;
109 InfiniteDimensionalMCMCSamplerOptions * m_ov;
112 const BaseEnvironment& m_env;
115 boost::shared_ptr<FunctionBase> current_physical_state;
118 boost::shared_ptr<FunctionBase> proposed_physical_state;
121 boost::shared_ptr<FunctionBase> current_physical_mean;
124 boost::shared_ptr<FunctionBase> current_physical_var;
127 boost::shared_ptr<FunctionBase> _delta;
130 boost::shared_ptr<FunctionBase> _M2;
142 hid_t _neg_log_llhd_dset;
143 hid_t _L2_norm_samples_dset;
144 hid_t _L2_norm_mean_dset;
145 hid_t _L2_norm_var_dset;
153 void _metropolis_hastings();
156 void _update_moments();
162 hid_t _create_scalar_dataset(
const std::string & name);
165 void _append_scalar_dataset(hid_t dset,
double data);
170 #endif // QUESO_INFINITE_SAMPLER_H
172 #endif // QUESO_HAVE_HDF5