3 namespace pt = boost::property_tree;
9 ISKernel::ISKernel(pt::ptree
const& pt, std::shared_ptr<SamplingProblem> problem) :
TransitionKernel(pt, problem) {}
11 ISKernel::~ISKernel() {}
14 const boost::any state =
problem->SampleBiasingDistribution(inputs);
17 dist_inputs.insert(dist_inputs.begin(), std::cref(state));
19 const double logTarget =
problem->EvaluateLogTarget(dist_inputs);
20 const double logBias =
problem->EvaluateLogBiasingDistribution(dist_inputs);
23 outputs[0] = std::make_shared<SamplingState>(state, std::exp(logTarget-logBias));
REGISTER_TRANSITION_KERNEL(ISKernel) ISKernel
Importance sampling transition kernel.
virtual void EvaluateImpl(muq::Modeling::ref_vector< boost::any > const &inputs) override
Defines the transition kernel used by an MCMC algorithm.
std::shared_ptr< AbstractSamplingProblem > problem
The sampling problem that evaluates/samples the target distribution.
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...