MUQ  0.4.3
muq::SamplingAlgorithms::MixtureProposal Class Reference

This class implements a weighted mixture of other proposals. More...

#include <MixtureProposal.h>

Inheritance diagram for muq::SamplingAlgorithms::MixtureProposal:

Detailed Description

This class implements a weighted mixture of other proposals.

This class implements proposals of the form

\[ p(x^\prime | x) = \sum_{i=1}^N w_i p_i(x^\prime | x), \]

where \(N\) is the total number of proposal components and \(w_i\) is the weight of the \(i^{th}\) component. Note that the weights must sum to one and are thus normalized after being passed to this class.

The components \(p_i(x^\prime | x)\) can be any other MCMC proposal.

Configuration Parameters:

Parameter Key Type Default Value Description
"Components" string - A comma separated list with the names of other blocks that define each component in the proposal mixture.
"Weights" string 1.0,1.0,... A comma separated list of floats defining the weights (potentially unnormalized) for each mixture component. If not specified, even weights are prescribed.

Definition at line 29 of file MixtureProposal.h.

Public Member Functions

 MixtureProposal (boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > const &prob)
 
 MixtureProposal (boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > const &prob, std::vector< std::shared_ptr< MCMCProposal >> const &proposals, std::vector< double > const &weights)
 
virtual ~MixtureProposal ()=default
 
- Public Member Functions inherited from muq::SamplingAlgorithms::MCMCProposal
 MCMCProposal (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > const &probIn)
 
virtual ~MCMCProposal ()=default
 
virtual void Adapt (unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &state)
 Adapt the proposal after each step. More...
 
void SetCommunicator (std::shared_ptr< parcer::Communicator > newcomm)
 
virtual void SetBlockInd (int newBlockInd)
 
virtual int GetBlockInd () const
 

Additional Inherited Members

- Public Types inherited from muq::SamplingAlgorithms::MCMCProposal
typedef std::function< std::shared_ptr< MCMCProposal >boost::property_tree::ptree, std::shared_ptr< AbstractSamplingProblem >)> MCMCProposalConstructor
 
typedef std::map< std::string, MCMCProposalConstructorMCMCProposalMap
 
- Static Public Member Functions inherited from muq::SamplingAlgorithms::MCMCProposal
static std::shared_ptr< MCMCProposalConstruct (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > const &probIn)
 Static constructor for the transition kernel. More...
 
static std::shared_ptr< MCMCProposalMapGetMCMCProposalMap ()
 

Constructor & Destructor Documentation

◆ MixtureProposal() [1/2]

muq::SamplingAlgorithms::MixtureProposal::MixtureProposal ( boost::property_tree::ptree  pt,
std::shared_ptr< AbstractSamplingProblem > const &  prob 
)

◆ MixtureProposal() [2/2]

MixtureProposal::MixtureProposal ( boost::property_tree::ptree  pt,
std::shared_ptr< AbstractSamplingProblem > const &  prob,
std::vector< std::shared_ptr< MCMCProposal >> const &  proposals,
std::vector< double > const &  weights 
)

Definition at line 23 of file MixtureProposal.cpp.

References proposals, and weights.

◆ ~MixtureProposal()

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

Member Function Documentation

◆ GetProposals()

std::vector< std::shared_ptr< MCMCProposal > > MixtureProposal::GetProposals ( boost::property_tree::ptree const &  pt,
std::shared_ptr< AbstractSamplingProblem > const &  prob 
)
staticprotected

Constructs the mixture proposals based on properties in the ptree.

Definition at line 46 of file MixtureProposal.cpp.

References muq::SamplingAlgorithms::MCMCProposal::Construct(), muq::SamplingAlgorithms::MCMCProposal::prob, and muq::Utilities::StringUtilities::Split().

◆ GetWeights()

std::vector< double > MixtureProposal::GetWeights ( boost::property_tree::ptree const &  pt)
staticprotected

Extracts the proposal weights from a ptree.

Definition at line 64 of file MixtureProposal.cpp.

References muq::Utilities::StringUtilities::Split(), and weights.

◆ LogDensity()

double MixtureProposal::LogDensity ( std::shared_ptr< SamplingState > const &  currState,
std::shared_ptr< SamplingState > const &  propState 
)
overrideprotectedvirtual

Implements muq::SamplingAlgorithms::MCMCProposal.

Definition at line 94 of file MixtureProposal.cpp.

References proposals, and weights.

◆ Sample()

std::shared_ptr< SamplingState > MixtureProposal::Sample ( std::shared_ptr< SamplingState > const &  currentState)
overrideprotectedvirtual

Implements muq::SamplingAlgorithms::MCMCProposal.

Definition at line 84 of file MixtureProposal.cpp.

References proposals, and weights.

Member Data Documentation

◆ proposals

std::vector<std::shared_ptr<MCMCProposal> > muq::SamplingAlgorithms::MixtureProposal::proposals
protected

The proposal distribution.

Definition at line 52 of file MixtureProposal.h.

Referenced by LogDensity(), MixtureProposal(), and Sample().

◆ weights

std::vector<double> muq::SamplingAlgorithms::MixtureProposal::weights
protected

Definition at line 53 of file MixtureProposal.h.

Referenced by GetWeights(), LogDensity(), MixtureProposal(), and Sample().


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