Defines the transition kernel used by an MCMC algorithm. More...
#include <TransitionKernel.h>
Defines the transition kernel used by an MCMC algorithm.
Definition at line 35 of file TransitionKernel.h.
Public Types | |
typedef boost::function< std::shared_ptr< TransitionKernel >boost::property_tree::ptree, std::shared_ptr< AbstractSamplingProblem >)> | TransitionKernelConstructor |
typedef std::map< std::string, TransitionKernelConstructor > | TransitionKernelMap |
Public Member Functions | |
TransitionKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) | |
virtual | ~TransitionKernel ()=default |
virtual void | SetCommunicator (std::shared_ptr< parcer::Communicator > newcomm) |
virtual void | PreStep (unsigned int const t, std::shared_ptr< SamplingState > state) |
Allow the kernel to preprocess the current step. More... | |
virtual void | PostStep (unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &state) |
Allow the kernel to adapt given a new state. More... | |
virtual std::vector< std::shared_ptr< SamplingState > > | Step (unsigned int const t, std::shared_ptr< SamplingState > prevState)=0 |
virtual void | PrintStatus () const |
virtual void | PrintStatus (std::string prefix) const |
virtual void | SetBlockInd (int newBlockInd) |
virtual int | GetBlockInd () const |
virtual std::shared_ptr< AbstractSamplingProblem > const & | Problem () const |
Static Public Member Functions | |
static std::shared_ptr< TransitionKernel > | Construct (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) |
Static constructor for the transition kernel. More... | |
static std::shared_ptr< TransitionKernelMap > | GetTransitionKernelMap () |
typedef boost::function<std::shared_ptr<TransitionKernel>boost::property_tree::ptree, std::shared_ptr<AbstractSamplingProblem>)> muq::SamplingAlgorithms::TransitionKernel::TransitionKernelConstructor |
Definition at line 53 of file TransitionKernel.h.
typedef std::map<std::string, TransitionKernelConstructor> muq::SamplingAlgorithms::TransitionKernel::TransitionKernelMap |
Definition at line 54 of file TransitionKernel.h.
TransitionKernel::TransitionKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem | ||
) |
Definition at line 7 of file TransitionKernel.cpp.
|
virtualdefault |
|
static |
Static constructor for the transition kernel.
[in] | pt | Parameters for the kernel |
[in] | problem | The sampling problem that evaluates/samples the distribution we are trying to characterize |
Definition at line 25 of file TransitionKernel.cpp.
References GetTransitionKernelMap(), and problem.
Referenced by muq::SamplingAlgorithms::MonteCarlo::ConstructKernel(), muq::SamplingAlgorithms::ParallelTempering::ExtractKernels(), and muq::SamplingAlgorithms::DILIKernel::UpdateKernels().
|
inlinevirtual |
Definition at line 85 of file TransitionKernel.h.
References blockInd.
|
static |
Definition at line 13 of file TransitionKernel.cpp.
Referenced by Construct().
|
inlinevirtual |
Allow the kernel to adapt given a new state.
By default this function does nothing but children can override it to adapt the kernel
[in] | t | The current step |
[in] | state | The current state |
Reimplemented in muq::SamplingAlgorithms::MIKernel, muq::SamplingAlgorithms::MIDummyKernel, muq::SamplingAlgorithms::MHKernel, muq::SamplingAlgorithms::DummyKernel, muq::SamplingAlgorithms::DRKernel, and muq::SamplingAlgorithms::DILIKernel.
Definition at line 71 of file TransitionKernel.h.
|
inlinevirtual |
Allow the kernel to preprocess the current step.
By default this function does nothing but children can override it to adapt the kernel
[in] | t | The current step |
[in] | state | The current state |
Reimplemented in muq::SamplingAlgorithms::GMHKernel.
Definition at line 63 of file TransitionKernel.h.
|
inlinevirtual |
Definition at line 79 of file TransitionKernel.h.
References PrintStatus().
Referenced by PrintStatus().
|
inlinevirtual |
Reimplemented in muq::SamplingAlgorithms::MIKernel, muq::SamplingAlgorithms::MIDummyKernel, muq::SamplingAlgorithms::MHKernel, muq::SamplingAlgorithms::DummyKernel, muq::SamplingAlgorithms::DRKernel, and muq::SamplingAlgorithms::DILIKernel.
Definition at line 80 of file TransitionKernel.h.
|
inlinevirtual |
Get access to the problem that this kernel is defined by.
Definition at line 88 of file TransitionKernel.h.
References problem.
|
inlinevirtual |
Reimplemented in muq::SamplingAlgorithms::MHKernel, and muq::SamplingAlgorithms::DRKernel.
Definition at line 84 of file TransitionKernel.h.
References blockInd.
|
virtual |
Definition at line 48 of file TransitionKernel.cpp.
References comm.
|
pure virtual |
[in] | t | The current step |
[in] | state | The current state |
Implemented in muq::SamplingAlgorithms::GMHKernel, muq::SamplingAlgorithms::MIKernel, muq::SamplingAlgorithms::MIDummyKernel, muq::SamplingAlgorithms::MHKernel, muq::SamplingAlgorithms::DummyKernel, muq::SamplingAlgorithms::DRKernel, and muq::SamplingAlgorithms::DILIKernel.
|
protected |
Definition at line 92 of file TransitionKernel.h.
Referenced by muq::SamplingAlgorithms::DILIKernel::ComputeLocalLIS(), muq::SamplingAlgorithms::DRKernel::EvaluateProposal(), GetBlockInd(), muq::SamplingAlgorithms::DRKernel::SampleProposal(), SetBlockInd(), muq::SamplingAlgorithms::DRKernel::SetBlockInd(), muq::SamplingAlgorithms::MHKernel::SetBlockInd(), muq::SamplingAlgorithms::DILIKernel::Step(), and muq::SamplingAlgorithms::DILIKernel::UpdateLIS().
|
protected |
|
protected |
The sampling problem that evaluates/samples the target distribution.
Definition at line 95 of file TransitionKernel.h.
Referenced by Construct(), muq::SamplingAlgorithms::DRKernel::CreateProposals(), muq::SamplingAlgorithms::ISKernel::EvaluateImpl(), muq::SamplingAlgorithms::DILIKernel::ExtractLikelihood(), muq::SamplingAlgorithms::DILIKernel::ExtractPrior(), Problem(), muq::SamplingAlgorithms::GMHKernel::SerialProposal(), muq::SamplingAlgorithms::MCKernel::Step(), muq::SamplingAlgorithms::DRKernel::Step(), muq::SamplingAlgorithms::DummyKernel::Step(), muq::SamplingAlgorithms::MHKernel::Step(), muq::SamplingAlgorithms::MIDummyKernel::Step(), and muq::SamplingAlgorithms::MIKernel::Step().
|
protected |
true: reevaluate the log density (even if one already exists), false: use stored log density
For example, if the log-density is a continually refined surrogate (LA-MCMC) or an importance sampling estimate (pseudo-marginal) then we need to reevaluate every time.
Definition at line 105 of file TransitionKernel.h.
Referenced by muq::SamplingAlgorithms::DRKernel::Step(), and muq::SamplingAlgorithms::MHKernel::Step().