26 #ifndef _POSTERIOR_MCMC_HPP_ 27 #define _POSTERIOR_MCMC_HPP_ 29 #include <boost/ptr_container/ptr_vector.hpp> 51 typedef boost::ptr_vector<NonParametricProcess> GPVect;
52 typedef boost::ptr_vector<Criteria> CritVect;
65 void updateHyperParameters();
66 void fitSurrogateModel();
67 void updateSurrogateModel();
69 double evaluateCriteria(
const vectord& query);
70 void updateCriteria(
const vectord& query);
72 bool criteriaRequiresComparison();
73 void setFirstCriterium();
74 bool setNextCriterium(
const vectord& prevResult);
75 std::string getBestCriteria(vectord& best);
80 void setSurrogateModel(randEngine& eng);
81 void setCriteria(randEngine& eng);
88 boost::scoped_ptr<MCMCSampler> kSampler;
97 inline void MCMCModel::fitSurrogateModel()
99 for(GPVect::iterator it=
mGP.begin(); it !=
mGP.end(); ++it)
100 it->fitSurrogateModel();
103 inline void MCMCModel::updateSurrogateModel()
105 for(GPVect::iterator it=
mGP.begin(); it !=
mGP.end(); ++it)
106 it->updateSurrogateModel();
109 inline double MCMCModel::evaluateCriteria(
const vectord& query)
112 for(CritVect::iterator it=
mCrit.begin(); it !=
mCrit.end(); ++it)
114 sum += it->evaluate(query);
116 return sum/
static_cast<double>(nParticles);
119 inline void MCMCModel::updateCriteria(
const vectord& query)
121 for(CritVect::iterator it=
mCrit.begin(); it !=
mCrit.end(); ++it)
128 inline bool MCMCModel::criteriaRequiresComparison()
129 {
return mCrit[0].requireComparison(); };
131 inline void MCMCModel::setFirstCriterium()
133 for(CritVect::iterator it=
mCrit.begin(); it !=
mCrit.end(); ++it)
135 it->initialCriteria();
143 inline bool MCMCModel::setNextCriterium(
const vectord& prevResult)
146 mCrit[0].pushResult(prevResult);
147 for(CritVect::iterator it=
mCrit.begin(); it !=
mCrit.end(); ++it)
149 rotated = it->rotateCriteria();
154 inline std::string MCMCModel::getBestCriteria(vectord& best)
155 {
return mCrit[0].getBestCriteria(best); };
159 {
return mGP[0].prediction(query); };
Namespace of the library interface.
GPVect mGP
Pointer to surrogate model.
Abstract interface for posterior model/criteria.
Markov Chain Monte Carlo algorithms.
Abstract and factory modules for criteria.
Posterior model of nonparametric processes/criteria based on MCMC samples.
CritVect mCrit
Metacriteria model.
Bayesian optimization using different non-parametric processes as distributions over surrogate functi...