MUQ  0.4.3
MixtureDistribution.h
Go to the documentation of this file.
1 #ifndef MIXTUREDISTRIBUTION_H_
2 #define MIXTUREDISTRIBUTION_H_
3 
5 
6 namespace muq {
7  namespace Modeling {
8 
15  public:
16 
21  MixtureDistribution(std::vector<std::shared_ptr<Distribution>> const& components,
22  Eigen::VectorXd const& probs);
23 
24  virtual ~MixtureDistribution() = default;
25 
31  virtual Eigen::VectorXd GradLogDensityImpl(unsigned int wrt,
32  ref_vector<Eigen::VectorXd> const& inputs) override;
33 
34 
36  std::vector<std::shared_ptr<Distribution>> Components(){return components;};
37 
39  Eigen::VectorXd Probabilities(){return probs;};
40 
41  protected:
42 
48  virtual double LogDensityImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
49 
51  virtual Eigen::VectorXd SampleImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
52 
53  std::vector<std::shared_ptr<Distribution>> components;
54  Eigen::VectorXd probs;
55 
56  };
57  } // namespace Modeling
58 } // namespace muq
59 
60 #endif
virtual Eigen::VectorXd GradLogDensityImpl(unsigned int wrt, ref_vector< Eigen::VectorXd > const &inputs) override
std::vector< std::shared_ptr< Distribution > > Components()
virtual Eigen::VectorXd SampleImpl(ref_vector< Eigen::VectorXd > const &inputs) override
Sample the distribution.
std::vector< std::shared_ptr< Distribution > > components
MixtureDistribution(std::vector< std::shared_ptr< Distribution >> const &components, Eigen::VectorXd const &probs)
virtual double LogDensityImpl(ref_vector< Eigen::VectorXd > const &inputs) override
virtual ~MixtureDistribution()=default
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37