MUQ  0.4.3
InverseGammaProposal.h
Go to the documentation of this file.
1 #ifndef INVERSEGAMMAPROPOSAL_H_
2 #define INVERSEGAMMAPROPOSAL_H_
3 
7 
9 
10 namespace muq {
11  namespace SamplingAlgorithms {
12 
44  public:
45 
46  InverseGammaProposal(boost::property_tree::ptree pt,
47  std::shared_ptr<AbstractSamplingProblem> prob);
48 
49  virtual ~InverseGammaProposal() = default;
50 
51  protected:
52 
54  const Eigen::VectorXd alpha;
55 
57  const Eigen::VectorXd beta;
58 
60  std::tuple<std::shared_ptr<muq::Modeling::ModPiece>, std::vector<int>, int> gaussInfo;
61 
63  std::shared_ptr<muq::Modeling::ModPiece> varModel;
64 
66  const Eigen::VectorXd gaussMean;
67 
68  virtual std::shared_ptr<SamplingState> Sample(std::shared_ptr<SamplingState> const& currentState) override;
69 
70  virtual double LogDensity(std::shared_ptr<SamplingState> const& currState,
71  std::shared_ptr<SamplingState> const& propState) override;
72 
78  virtual Eigen::VectorXd GetGaussianInput(std::shared_ptr<SamplingState> const& currentState) const;
79 
80  static Eigen::VectorXd ExtractMean(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& gaussNode);
81 
88  static std::shared_ptr<muq::Modeling::ModPiece> ExtractVarianceModel(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& gaussNode, std::string const& igNode);
89 
90  static std::shared_ptr<muq::Modeling::InverseGamma> ExtractInverseGamma(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& igNode);
91  static Eigen::VectorXd ExtractAlpha(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& igNode);
92  static Eigen::VectorXd ExtractBeta(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& igNode);
93  static std::tuple<std::shared_ptr<muq::Modeling::ModPiece>, std::vector<int>, int> ExtractGaussInfo(std::shared_ptr<AbstractSamplingProblem> prob, std::string const& gaussNode);
94  };
95 
96  } // namespace SamplingAlgoirthms
97 } // namespace muq
98 
99 #endif
Defines a proposal using the analytic conditional Inverse Gamma distribution for the variance of a Ga...
const Eigen::VectorXd alpha
The prior value of alpha.
virtual Eigen::VectorXd GetGaussianInput(std::shared_ptr< SamplingState > const &currentState) const
virtual std::shared_ptr< SamplingState > Sample(std::shared_ptr< SamplingState > const &currentState) override
static std::shared_ptr< muq::Modeling::ModPiece > ExtractVarianceModel(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &gaussNode, std::string const &igNode)
const Eigen::VectorXd beta
The prior value of beta.
InverseGammaProposal(boost::property_tree::ptree pt, std::shared_ptr< AbstractSamplingProblem > prob)
std::tuple< std::shared_ptr< muq::Modeling::ModPiece >, std::vector< int >, int > gaussInfo
The index of the Gaussian block.
static Eigen::VectorXd ExtractMean(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &gaussNode)
std::shared_ptr< muq::Modeling::ModPiece > varModel
A ModPiece containing an orthogonal matrix mapping the parameters to Gaussian variance.
virtual double LogDensity(std::shared_ptr< SamplingState > const &currState, std::shared_ptr< SamplingState > const &propState) override
static std::tuple< std::shared_ptr< muq::Modeling::ModPiece >, std::vector< int >, int > ExtractGaussInfo(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &gaussNode)
static Eigen::VectorXd ExtractBeta(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &igNode)
static Eigen::VectorXd ExtractAlpha(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &igNode)
const Eigen::VectorXd gaussMean
The mean of the Gaussian distribution.
static std::shared_ptr< muq::Modeling::InverseGamma > ExtractInverseGamma(std::shared_ptr< AbstractSamplingProblem > prob, std::string const &igNode)
std::shared_ptr< AbstractSamplingProblem > prob
Definition: MCMCProposal.h:81