7 namespace pt = boost::property_tree;
12 const std::size_t numLevels = 2;
13 const std::size_t baseRefinement = 25;
14 std::vector<std::shared_ptr<ModPiece> > logDensities =
ConstructDensities(numLevels, baseRefinement);
18 options.put(
"NumInitialSamples", 1000);
19 options.put(
"GreedyTargetVariance", 0.05);
20 options.put(
"verbosity", 1);
21 options.put(
"MLMCMC.Subsampling_0", 8);
22 options.put(
"MLMCMC.Subsampling_1", 4);
23 options.put(
"MLMCMC.Subsampling_2", 2);
24 options.put(
"MLMCMC.Subsampling_3", 0);
26 options.put(
"Proposal.Method",
"MHProposal");
27 options.put(
"Proposal.ProposalVariance", 1.0);
29 Eigen::VectorXd theta0 = Eigen::VectorXd::Zero(logDensities[0]->inputSizes(0));
32 std::shared_ptr<MultiIndexEstimator> estimator = sampler.
Run();
34 std::cout <<
"Mean: " << estimator->Mean().transpose() << std::endl;
35 std::cout <<
"Variance: " << estimator->Variance().transpose() << std::endl;
37 const std::string filename =
"output.h5";
std::vector< std::shared_ptr< ModPiece > > ConstructDensities()
Greedy Multilevel MCMC method.
void WriteToFile(std::string filename)
virtual std::shared_ptr< MultiIndexEstimator > Run()