MUQ  0.4.3
muq::SamplingAlgorithms::AbstractSamplingProblem Class Referenceabstract

Abstract base class for MCMC and Importance Sampling problems. More...

#include <AbstractSamplingProblem.h>

Inheritance diagram for muq::SamplingAlgorithms::AbstractSamplingProblem:

Detailed Description

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< AbstractSamplingProblemClone () const
 
virtual Eigen::VectorXd GradLogDensity (std::shared_ptr< SamplingState > const &state, unsigned const blockWrt)
 
virtual std::shared_ptr< SamplingStateQOI ()
 
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
 

Constructor & Destructor Documentation

◆ AbstractSamplingProblem() [1/2]

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() [2/2]

AbstractSamplingProblem::AbstractSamplingProblem ( Eigen::VectorXi const &  blockSizesIn)

Definition at line 19 of file AbstractSamplingProblem.cpp.

◆ ~AbstractSamplingProblem()

virtual muq::SamplingAlgorithms::AbstractSamplingProblem::~AbstractSamplingProblem ( )
virtualdefault

Member Function Documentation

◆ AddOptions()

virtual void muq::SamplingAlgorithms::AbstractSamplingProblem::AddOptions ( boost::property_tree::ptree &  pt) const
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.

◆ Clone()

virtual std::shared_ptr<AbstractSamplingProblem> muq::SamplingAlgorithms::AbstractSamplingProblem::Clone ( ) const
inlinevirtual

◆ GradLogDensity()

Eigen::VectorXd AbstractSamplingProblem::GradLogDensity ( std::shared_ptr< SamplingState > const &  state,
unsigned const  blockWrt 
)
virtual

Default finite difference gradient implementation.

Reimplemented in muq::SamplingAlgorithms::SamplingProblem, and muq::SamplingAlgorithms::InferenceProblem.

Definition at line 29 of file AbstractSamplingProblem.cpp.

◆ LogDensity()

virtual double muq::SamplingAlgorithms::AbstractSamplingProblem::LogDensity ( std::shared_ptr< SamplingState > const &  state)
pure virtual

◆ QOI()

Member Data Documentation

◆ blockSizes

const Eigen::VectorXi muq::SamplingAlgorithms::AbstractSamplingProblem::blockSizes

Definition at line 59 of file AbstractSamplingProblem.h.

Referenced by AbstractSamplingProblem().

◆ blockSizesQOI

const Eigen::VectorXi muq::SamplingAlgorithms::AbstractSamplingProblem::blockSizesQOI

Definition at line 61 of file AbstractSamplingProblem.h.

Referenced by AbstractSamplingProblem().

◆ numBlocks

const int muq::SamplingAlgorithms::AbstractSamplingProblem::numBlocks

◆ numBlocksQOI

const int muq::SamplingAlgorithms::AbstractSamplingProblem::numBlocksQOI

Definition at line 60 of file AbstractSamplingProblem.h.

Referenced by AbstractSamplingProblem().


The documentation for this class was generated from the following files: