7 namespace SamplingAlgorithms {
25 std::shared_ptr<AbstractSamplingProblem>
const&
prob);
34 std::shared_ptr<AbstractSamplingProblem>
const&
prob,
35 Eigen::MatrixXd
const& initialCov);
46 virtual void Adapt(
unsigned int const t, std::vector<std::shared_ptr<SamplingState>>
const& states)
override;
54 std::shared_ptr<AbstractSamplingProblem>
const&
prob);
57 virtual std::shared_ptr<SamplingState>
Sample(std::shared_ptr<SamplingState>
const& currentState)
override;
59 virtual double LogDensity(std::shared_ptr<SamplingState>
const& currState,
60 std::shared_ptr<SamplingState>
const& propState)
override;
76 Eigen::LLT<Eigen::MatrixXd, Eigen::Lower>
propChol;
An implemental of the Adaptive Metropolis algorithm.
virtual std::shared_ptr< SamplingState > Sample(std::shared_ptr< SamplingState > const ¤tState) override
Eigen::LLT< Eigen::MatrixXd, Eigen::Lower > propChol
The Cholesky factorization of the current proposal covariance.
virtual Eigen::MatrixXd ProposalCovariance() const
AMProposal(boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > const &prob, Eigen::MatrixXd const &initialCov)
AMProposal(boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > const &prob)
Eigen::VectorXd mean
The current mean.
static Eigen::MatrixXd ConstructCovariance(boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > const &prob)
Eigen::MatrixXd propCov
The current proposal covariance.
Eigen::MatrixXd newSamps
Samples seen between visits.
virtual void Adapt(unsigned int const t, std::vector< std::shared_ptr< SamplingState >> const &states) override
Adapt the proposal after each step.
const unsigned int adaptStart
When should we start adapting?
const unsigned int adaptEnd
After how many iterations should we stop adapting?
virtual ~AMProposal()=default
unsigned int numAdaptSamps
Total number of samples that have been used so far to compute mean and covariance.
const unsigned int adaptSteps
How frequently should we update the adaption?
virtual double LogDensity(std::shared_ptr< SamplingState > const &currState, std::shared_ptr< SamplingState > const &propState) override
std::shared_ptr< AbstractSamplingProblem > prob