MUQ  0.4.3
RandomVariable.h
Go to the documentation of this file.
1 #ifndef RANDOMVARIABLE_H
2 #define RANDOMVARIABLE_H
3 
6 
7 namespace muq{
8  namespace Modeling{
9 
10  class RandomVariable : public Distribution, public ModPiece{
11 
12  public:
13  RandomVariable(std::shared_ptr<Distribution> distIn);
14 
15  virtual ~RandomVariable() = default;
16 
17  protected:
18  std::shared_ptr<Distribution> dist;
19 
20  virtual void EvaluateImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
21 
22  virtual double LogDensityImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
23  virtual Eigen::VectorXd GradLogDensityImpl(unsigned int wrt, ref_vector<Eigen::VectorXd> const& inputs) override;
24  virtual Eigen::VectorXd SampleImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
25 
26  }; // class RandomVariable
27 
28  } // namespace Modeling
29 } // namespace muq
30 
31 
32 
33 #endif // #ifndef RANDOMVARIABLE_H
Provides an abstract interface for defining vector-valued model components.
Definition: ModPiece.h:148
virtual ~RandomVariable()=default
virtual Eigen::VectorXd GradLogDensityImpl(unsigned int wrt, ref_vector< Eigen::VectorXd > const &inputs) override
virtual Eigen::VectorXd SampleImpl(ref_vector< Eigen::VectorXd > const &inputs) override
Sample the distribution.
virtual double LogDensityImpl(ref_vector< Eigen::VectorXd > const &inputs) override
Implement the log-density.
std::shared_ptr< Distribution > dist
virtual void EvaluateImpl(ref_vector< Eigen::VectorXd > const &inputs) override
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37