|
|
virtual void | Initialize () override |
| |
| virtual void | Advance (size_t nSteps=1) override |
| |
|
virtual void | Finalize () override |
| |
|
virtual size_t | NumberOfChains () override |
| |
|
virtual const Chain & | GetChain (size_t cIndex=0) override |
| |
|
void | SetNumberOfChains (size_t nChains) |
| |
|
template<typename ContainerT = std::initializer_list<double>> |
| void | SetBetas (ContainerT betas) |
| |
|
const std::vector< double > & | GetBetas () const |
| |
|
template<typename ProposalT , typename... ArgsT> |
| void | SetProposalFunction (ArgsT &&...args) |
| |
|
void | SetProposalFunction (std::shared_ptr< Proposal > proposalFunction) |
| |
|
std::shared_ptr< Proposal > | GetProposalFunction () |
| |
|
std::shared_ptr< const Proposal > | GetProposalFunction () const |
| |
|
void | SetRandomizeStartPoint (bool randomizeStartPoint) |
| |
|
bool | IsRandomizeStartPoint () const |
| |
|
void | SetMultiThreading (bool enable) |
| |
|
bool | IsMultiThreading () const |
| |
| double | GetSwapAcceptanceRate (size_t iChain, ptrdiff_t iBeta=-1) const |
| | Get the fraction of accepted swaps between tempered chains. More...
|
| |
| void | SetParameterConfig (const ParameterConfig ¶mConfig) |
| | Set the parameter configuration. More...
|
| |
|
const ParameterConfig & | GetParameterConfig () const |
| |
|
void | SetPrior (DefaultCallable prior) |
| |
|
template<size_t NParams, typename CallableT > |
| void | SetPrior (CallableT prior) |
| |
|
void | SetLikelihood (DefaultCallable likelihood) |
| |
|
template<size_t NParams, typename CallableT > |
| void | SetLikelihood (CallableT likelihood) |
| |
|
void | SetNegLogLikelihood (DefaultCallable negLoglikelihood) |
| |
|
template<size_t NParams, typename CallableT > |
| void | SetNegLogLikelihood (CallableT negLoglikelihood) |
| |
|
void | SetTotalLength (size_t length) |
| |
|
size_t | GetTotalLength () const |
| |
| template<typename WriterT , typename... ArgsT> |
| void | AddWriter (ArgsT &&...args) |
| | Add an output writer by specifying its type and passing constructor arguments. More...
|
| |
|
void | AddWriter (std::shared_ptr< Writer > writer) |
| |
| double | EvaluatePrior (const std::vector< double > ¶mValues) const |
| | Evaluate the prior for the given parameter values. More...
|
| |
| double | EvaluateLikelihood (const std::vector< double > ¶mValues) const |
| | Evaluate the target function likelihood for the given parameter values. More...
|
| |
| double | EvaluateNegLogLikelihood (const std::vector< double > ¶mValues) const |
| | Evaluate the target function -log(likelihood) for the given parameter values. More...
|
| |
| bool | Evaluate (Sample &sample) const |
| | Evalutate the target function prior, likelihood and -log(likelihood) at the position defined by the sample, and update the sample accordingly. More...
|
| |
|
void | Run () |
| | Start sampling!
|
| |
|
ChainSetStatistics & | GetStatistics () |
| |
|
const ChainSetStatistics & | GetStatistics () const |
| |
Implementation of the Metropolis-Hastings algorithm.
The transition kernel alias proposal function can be defined by the user according to the interface of #Proposal. By default, a multivariate Gaussian is used, based on the parameter configuration.
Parallel tempering (useful for multimodal likelihoods) can be activated by specifying additional values for beta < 1 (reciprocal temperature), thus constructing flatter distributions. For each value of beta, an individual sampling chain, together with it's own parameter configuration and proposal function is set up.