An implementation of the standard Metropolis-Hastings transition kernel. More...
#include <MHKernel.h>
An implementation of the standard Metropolis-Hastings transition kernel.
Configuration Parameters:
Parameter Key | Type | Default Value | Description |
---|---|---|---|
"Proposal" | String | - | A string pointing to a block of proposal options. |
Definition at line 22 of file MHKernel.h.
Public Member Functions | |
MHKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem) | |
MHKernel (boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > problem, std::shared_ptr< MCMCProposal > proposalIn) | |
virtual | ~MHKernel ()=default |
virtual std::shared_ptr< MCMCProposal > | Proposal () |
virtual void | PostStep (unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &state) override |
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) override |
virtual void | PrintStatus (std::string prefix) const override |
virtual double | AcceptanceRate () const |
virtual void | SetBlockInd (int newBlockInd) override |
Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel | |
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 | PrintStatus () const |
virtual int | GetBlockInd () const |
virtual std::shared_ptr< AbstractSamplingProblem > const & | Problem () const |
Additional Inherited Members | |
Public Types inherited from muq::SamplingAlgorithms::TransitionKernel | |
typedef boost::function< std::shared_ptr< TransitionKernel >boost::property_tree::ptree, std::shared_ptr< AbstractSamplingProblem >)> | TransitionKernelConstructor |
typedef std::map< std::string, TransitionKernelConstructor > | TransitionKernelMap |
Static Public Member Functions inherited from muq::SamplingAlgorithms::TransitionKernel | |
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 () |
muq::SamplingAlgorithms::MHKernel::MHKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem | ||
) |
muq::SamplingAlgorithms::MHKernel::MHKernel | ( | boost::property_tree::ptree const & | pt, |
std::shared_ptr< AbstractSamplingProblem > | problem, | ||
std::shared_ptr< MCMCProposal > | proposalIn | ||
) |
|
virtualdefault |
|
inlinevirtual |
Definition at line 43 of file MHKernel.h.
References numAccepts, and numCalls.
|
overridevirtual |
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 from muq::SamplingAlgorithms::TransitionKernel.
Definition at line 36 of file MHKernel.cpp.
References proposal.
|
overridevirtual |
Reimplemented from muq::SamplingAlgorithms::TransitionKernel.
Definition at line 97 of file MHKernel.cpp.
References numAccepts, and numCalls.
|
inlinevirtual |
Definition at line 34 of file MHKernel.h.
References proposal.
|
inlineoverridevirtual |
Reimplemented from muq::SamplingAlgorithms::TransitionKernel.
Definition at line 45 of file MHKernel.h.
References muq::SamplingAlgorithms::TransitionKernel::blockInd, and proposal.
|
overridevirtual |
[in] | t | The current step |
[in] | state | The current state |
Implements muq::SamplingAlgorithms::TransitionKernel.
Reimplemented in muq::SamplingAlgorithms::GMHKernel.
Definition at line 40 of file MHKernel.cpp.
References nlohmann::detail::dtoa_impl::e, numAccepts, numCalls, muq::SamplingAlgorithms::TransitionKernel::problem, proposal, and muq::SamplingAlgorithms::TransitionKernel::reeval.
|
protected |
Definition at line 51 of file MHKernel.h.
Referenced by AcceptanceRate(), PrintStatus(), and Step().
|
protected |
Definition at line 50 of file MHKernel.h.
Referenced by AcceptanceRate(), PrintStatus(), and Step().
|
protected |
Definition at line 48 of file MHKernel.h.
Referenced by muq::SamplingAlgorithms::GMHKernel::AcceptanceDensity(), PostStep(), Proposal(), muq::SamplingAlgorithms::GMHKernel::SerialProposal(), SetBlockInd(), and Step().