Abstract base class for MCMC and Importance Sampling problems. More...
#include <AbstractSamplingProblem.h>
Abstract base class for MCMC and Importance Sampling problems.
Assumes we are interested in sampling some probability density \(\pi(x_1, x_2, \ldots, x_N)\), where each input \(x_i\) is a vector valued block. For instance, \(x_1\) could be a Gaussian random variable and \(x_2\) could be a vector containing the mean and variance hyperparameters. The block structure is primarily used in Gibbs or Metropolis-in-Gibbs MCMC algorithms.
Both the number of blocks and the size of the blocks are stored. However, if one of the blocks is not a vector type, it is safe to set the block size to -1.
Definition at line 29 of file AbstractSamplingProblem.h.
Public Member Functions | |
AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn, Eigen::VectorXi const &blockSizesQOIIn) | |
AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn) | |
virtual | ~AbstractSamplingProblem ()=default |
virtual double | LogDensity (std::shared_ptr< SamplingState > const &state)=0 |
virtual std::shared_ptr< AbstractSamplingProblem > | Clone () const |
virtual Eigen::VectorXd | GradLogDensity (std::shared_ptr< SamplingState > const &state, unsigned const blockWrt) |
virtual std::shared_ptr< SamplingState > | QOI () |
virtual void | AddOptions (boost::property_tree::ptree &pt) const |
Public Attributes | |
const int | numBlocks |
const Eigen::VectorXi | blockSizes |
const int | numBlocksQOI |
const Eigen::VectorXi | blockSizesQOI |
AbstractSamplingProblem::AbstractSamplingProblem | ( | Eigen::VectorXi const & | blockSizesIn, |
Eigen::VectorXi const & | blockSizesQOIIn | ||
) |
Definition at line 8 of file AbstractSamplingProblem.cpp.
References blockSizes, blockSizesQOI, numBlocks, and numBlocksQOI.
AbstractSamplingProblem::AbstractSamplingProblem | ( | Eigen::VectorXi const & | blockSizesIn | ) |
Definition at line 19 of file AbstractSamplingProblem.cpp.
|
virtualdefault |
|
inlinevirtual |
Sometimes, there will be problem-specific options that need to be passed to the SamplingAlgorithm. This function adds any of those options to the given property_tree.
Reimplemented in muq::SamplingAlgorithms::ExpensiveSamplingProblem.
Definition at line 56 of file AbstractSamplingProblem.h.
|
inlinevirtual |
Reimplemented in muq::SamplingAlgorithms::SamplingProblem, and muq::SamplingAlgorithms::InferenceProblem.
Definition at line 42 of file AbstractSamplingProblem.h.
|
virtual |
Default finite difference gradient implementation.
Reimplemented in muq::SamplingAlgorithms::SamplingProblem, and muq::SamplingAlgorithms::InferenceProblem.
Definition at line 29 of file AbstractSamplingProblem.cpp.
|
pure virtual |
|
virtual |
Reimplemented in muq::SamplingAlgorithms::SamplingProblem, muq::SamplingAlgorithms::ParallelAbstractSamplingProblem, muq::SamplingAlgorithms::InferenceProblem, and muq::SamplingAlgorithms::ExpensiveSamplingProblem.
Definition at line 25 of file AbstractSamplingProblem.cpp.
const Eigen::VectorXi muq::SamplingAlgorithms::AbstractSamplingProblem::blockSizes |
Definition at line 59 of file AbstractSamplingProblem.h.
Referenced by AbstractSamplingProblem().
const Eigen::VectorXi muq::SamplingAlgorithms::AbstractSamplingProblem::blockSizesQOI |
Definition at line 61 of file AbstractSamplingProblem.h.
Referenced by AbstractSamplingProblem().
const int muq::SamplingAlgorithms::AbstractSamplingProblem::numBlocks |
Definition at line 58 of file AbstractSamplingProblem.h.
Referenced by AbstractSamplingProblem(), and muq::SamplingAlgorithms::SamplingProblem::GetBlockSizes().
const int muq::SamplingAlgorithms::AbstractSamplingProblem::numBlocksQOI |
Definition at line 60 of file AbstractSamplingProblem.h.
Referenced by AbstractSamplingProblem().