MUQ  0.4.3
KarhunenLoeveExpansion.h
Go to the documentation of this file.
1 #ifndef KARHUNENLOEVEEXPANSION_H
2 #define KARHUNENLOEVEEXPANSION_H
3 
4 #include <Eigen/Core>
5 
8 
9 #include <boost/property_tree/ptree.hpp>
10 
11 namespace muq
12 {
13 namespace Approximation
14 {
15 
99  {
100 
101  public:
102 
103  KarhunenLoeveExpansion(std::shared_ptr<KernelBase> kernelIn,
104  Eigen::MatrixXd const& seedPtsIn,
105  Eigen::VectorXd const& seedWtsIn,
106  boost::property_tree::ptree options = boost::property_tree::ptree());
107 
108  virtual ~KarhunenLoeveExpansion() = default;
109 
112  virtual Eigen::MatrixXd GetModes(Eigen::Ref<const Eigen::MatrixXd> const& pts) const override;
113 
114  virtual unsigned int NumModes() const override;
115 
116  private:
117 
118 
119  // Points used to discretize the KL modes.
120  Eigen::MatrixXd seedPts;
121  Eigen::VectorXd seedWts;
122 
123  // The covariance kernel used to construct this expansion
124  std::shared_ptr<KernelBase> covKernel;
125 
126  // Values of the KL modes at the seed points. Each column corresponds to a basis function and each row to a pt function
127  Eigen::MatrixXd modeVecs;
128  Eigen::VectorXd modeEigs;
129 
130  }; // class KarhuneLoeveExpansion
131 
132 
133 
134 }// namespace Approximation
135 }// namespace muq
136 
137 
138 #endif
Used to compute and evaluate the Karhunen-Loeve decomposition of a zero mean Gaussian process....
virtual Eigen::MatrixXd GetModes(Eigen::Ref< const Eigen::MatrixXd > const &pts) const override
KarhunenLoeveExpansion(std::shared_ptr< KernelBase > kernelIn, Eigen::MatrixXd const &seedPtsIn, Eigen::VectorXd const &seedWtsIn, boost::property_tree::ptree options=boost::property_tree::ptree())
virtual unsigned int NumModes() const override