3 namespace pt = boost::property_tree;
9 MCKernel::MCKernel(pt::ptree
const& pt, std::shared_ptr<SamplingProblem> problem) :
TransitionKernel(pt, problem) {}
11 std::vector<std::shared_ptr<SamplingState>> MCKernel::Step(std::shared_ptr<SamplingState> prevState)
13 const boost::any newState =
problem->GetDistribution()->Sample(prevState->state);
14 return std::vector<std::shared_ptr<SamplingState>>(1,std::make_shared<SamplingState>(newState, 1.0));
REGISTER_TRANSITION_KERNEL(MCKernel) MCKernel
Monte Carlo transition kernel.
Defines the transition kernel used by an MCMC algorithm.
std::shared_ptr< AbstractSamplingProblem > problem
The sampling problem that evaluates/samples the target distribution.