MUQ  0.4.3
MixtureProposal.h
Go to the documentation of this file.
1 #ifndef MIXTUREPROPOSAL_H_
2 #define MIXTUREPROPOSAL_H_
3 
5 
6 namespace muq {
7  namespace SamplingAlgorithms {
8 
29  class MixtureProposal : public MCMCProposal {
30  public:
31 
32  MixtureProposal(boost::property_tree::ptree pt,
33  std::shared_ptr<AbstractSamplingProblem> const& prob);
34 
35  MixtureProposal(boost::property_tree::ptree pt,
36  std::shared_ptr<AbstractSamplingProblem> const& prob,
37  std::vector<std::shared_ptr<MCMCProposal>> const& proposals,
38  std::vector<double> const& weights);
39 
40  virtual ~MixtureProposal() = default;
41 
42  protected:
43 
45  static std::vector<double> GetWeights(boost::property_tree::ptree const& pt);
46 
48  static std::vector<std::shared_ptr<MCMCProposal>> GetProposals(boost::property_tree::ptree const& pt,
49  std::shared_ptr<AbstractSamplingProblem> const& prob);
50 
52  std::vector<std::shared_ptr<MCMCProposal>> proposals;
53  std::vector<double> weights;
54 
55  virtual std::shared_ptr<SamplingState> Sample(std::shared_ptr<SamplingState> const& currentState) override;
56 
57  virtual double LogDensity(std::shared_ptr<SamplingState> const& currState,
58  std::shared_ptr<SamplingState> const& propState) override;
59 
60 
61  };
62 
63  } // namespace SamplingAlgoirthms
64 } // namespace muq
65 
66 #endif
std::shared_ptr< AbstractSamplingProblem > prob
Definition: MCMCProposal.h:81
This class implements a weighted mixture of other proposals.
virtual double LogDensity(std::shared_ptr< SamplingState > const &currState, std::shared_ptr< SamplingState > const &propState) override
static std::vector< std::shared_ptr< MCMCProposal > > GetProposals(boost::property_tree::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > const &prob)
static std::vector< double > GetWeights(boost::property_tree::ptree const &pt)
MixtureProposal(boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > const &prob)
std::vector< std::shared_ptr< MCMCProposal > > proposals
The proposal distribution.
virtual std::shared_ptr< SamplingState > Sample(std::shared_ptr< SamplingState > const &currentState) override