MUQ  0.4.3
muq::SamplingAlgorithms::CrankNicolsonProposal Class Reference

An implement of the dimension-independent pCN proposal. More...

#include <CrankNicolsonProposal.h>

Inheritance diagram for muq::SamplingAlgorithms::CrankNicolsonProposal:

Detailed Description

An implement of the dimension-independent pCN proposal.

This class implements the preconditioned Crank Nicolson proposal (pCN) from Cotter et al., 2013. The proposal takes the form

\[ u^\prime = \bar{u} + \sqrt{ 1 - \beta^2} (u_c-\bar{u}) + \beta z, \]

where \(\bar{u}\) is an estimate of the posterior mean (e.g., the prior mean or posterior MAP), \(u_c\) is the current state of the chain, \(z\sim N(0,C)\) is a normal random variable with a strategically chosen covariance \(C\) (often the prior covariance), and \(u^\prime\) is the propsed point. The parameter \(\beta\) is a tuning parameter.

Configuration Parameters:

Parameter Key Type Default Value Description
"Beta" Double 0.5 The proposal scaling \(\beta\) defined above.
"PriorNode" String - (Optional.) If specified, this class assumes the target density was constructed from a WorkGraph and will look set the value of the covariance \(C\) to the covariance of the Gaussian density at the specified node.

Definition at line 33 of file CrankNicolsonProposal.h.

Public Member Functions

 CrankNicolsonProposal (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > prob, std::shared_ptr< muq::Modeling::GaussianBase > prior)
 
 CrankNicolsonProposal (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > prob)
 
virtual ~CrankNicolsonProposal ()=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

◆ CrankNicolsonProposal() [1/2]

muq::SamplingAlgorithms::CrankNicolsonProposal::CrankNicolsonProposal ( boost::property_tree::ptree const &  pt,
std::shared_ptr< AbstractSamplingProblem prob,
std::shared_ptr< muq::Modeling::GaussianBase prior 
)

◆ CrankNicolsonProposal() [2/2]

CrankNicolsonProposal::CrankNicolsonProposal ( boost::property_tree::ptree const &  pt,
std::shared_ptr< AbstractSamplingProblem prob 
)

◆ ~CrankNicolsonProposal()

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

Member Function Documentation

◆ ExtractPrior()

void CrankNicolsonProposal::ExtractPrior ( std::shared_ptr< AbstractSamplingProblem > const &  prob,
std::string  nodeName 
)
protected

◆ GetPriorInputs()

std::vector< Eigen::VectorXd > CrankNicolsonProposal::GetPriorInputs ( std::vector< Eigen::VectorXd > const &  currState)
protected

Definition at line 61 of file CrankNicolsonProposal.cpp.

References priorCovInds, priorCovModel, priorMeanInds, and priorMeanModel.

Referenced by LogDensity(), and Sample().

◆ LogDensity()

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

◆ Sample()

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

Member Data Documentation

◆ beta

double muq::SamplingAlgorithms::CrankNicolsonProposal::beta
protected

Definition at line 47 of file CrankNicolsonProposal.h.

Referenced by LogDensity(), and Sample().

◆ priorCovInds

std::vector<int> muq::SamplingAlgorithms::CrankNicolsonProposal::priorCovInds
protected

Definition at line 54 of file CrankNicolsonProposal.h.

Referenced by ExtractPrior(), and GetPriorInputs().

◆ priorCovModel

std::shared_ptr<muq::Modeling::ModPiece> muq::SamplingAlgorithms::CrankNicolsonProposal::priorCovModel
protected

Definition at line 53 of file CrankNicolsonProposal.h.

Referenced by ExtractPrior(), and GetPriorInputs().

◆ priorDist

std::shared_ptr<muq::Modeling::GaussianBase> muq::SamplingAlgorithms::CrankNicolsonProposal::priorDist
protected

The proposal distribution.

Definition at line 65 of file CrankNicolsonProposal.h.

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

◆ priorMeanInds

std::vector<int> muq::SamplingAlgorithms::CrankNicolsonProposal::priorMeanInds
protected

Definition at line 51 of file CrankNicolsonProposal.h.

Referenced by ExtractPrior(), and GetPriorInputs().

◆ priorMeanModel

std::shared_ptr<muq::Modeling::ModPiece> muq::SamplingAlgorithms::CrankNicolsonProposal::priorMeanModel
protected

Definition at line 50 of file CrankNicolsonProposal.h.

Referenced by ExtractPrior(), and GetPriorInputs().

◆ priorUsesCov

bool muq::SamplingAlgorithms::CrankNicolsonProposal::priorUsesCov
protected

Definition at line 55 of file CrankNicolsonProposal.h.

Referenced by ExtractPrior().


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