4 #include <boost/property_tree/ptree.hpp>
18 namespace Approximation {
29 Regression(boost::property_tree::ptree
const& pt);
37 void Fit(std::vector<Eigen::VectorXd> xs, std::vector<Eigen::VectorXd>
const& ys, Eigen::VectorXd
const& center);
44 void Fit(std::vector<Eigen::VectorXd>
const& xs, std::vector<Eigen::VectorXd>
const& ys);
54 std::pair<Eigen::VectorXd, double>
PoisednessConstant(std::vector<Eigen::VectorXd> xs, Eigen::VectorXd
const& center,
int kn = -1)
const;
72 Eigen::MatrixXd
ComputeCoefficients(std::vector<Eigen::VectorXd>
const& xs, std::vector<Eigen::VectorXd>
const& ys)
const;
79 Eigen::MatrixXd
ComputeCoefficientsRHS(Eigen::MatrixXd
const& vand, std::vector<Eigen::VectorXd>
const& ys_data)
const;
93 Eigen::ArrayXd
CenterPoints(std::vector<Eigen::VectorXd>& xs);
100 Eigen::ArrayXd
CenterPoints(std::vector<Eigen::VectorXd>& xs, Eigen::VectorXd
const& center)
const;
109 Eigen::ArrayXd
CenterPoints(std::vector<Eigen::VectorXd>& xs, Eigen::VectorXd
const& center,
unsigned int const kn)
const;
118 virtual double Cost()
override;
124 std::shared_ptr<Regression const>
parent;
140 virtual void JacobianImpl(
unsigned int const outputDimWrt,
141 unsigned int const inputDimWrt,
157 std::shared_ptr<muq::Utilities::MultiIndexSet>
multi;
160 std::shared_ptr<IndexedScalarBasis>
poly;
virtual void JacobianImpl(unsigned int const outputDimWrt, unsigned int const inputDimWrt, muq::Modeling::ref_vector< Eigen::VectorXd > const &input) override
PoisednessConstraint(unsigned int const inDim, double const alpha)
virtual ~PoisednessConstraint()=default
virtual void EvaluateImpl(muq::Modeling::ref_vector< Eigen::VectorXd > const &input) override
std::shared_ptr< Regression const > parent
const std::vector< Eigen::RowVectorXd > & lagrangeCoeff
virtual void GradientImpl(unsigned int outWrt, unsigned int inWrt, muq::Modeling::ref_vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &sensitivity) override
Compute the gradient of the cost function.
PoisednessCost(std::shared_ptr< Regression const > parent, std::vector< Eigen::RowVectorXd > const &lagrangeCoeff, unsigned int const inDim)
virtual double Cost() override
virtual ~PoisednessCost()=default
Eigen::ArrayXd currentRadius
Current radius of inputs.
boost::property_tree::ptree optPt
Parameters for the poisedness cosntant optimization.
const double alpha
The radius of the poisedness constraint.
void ComputeBasisDerivatives(Eigen::VectorXd const &point, std::vector< Eigen::VectorXd > &gradient) const
virtual void EvaluateImpl(muq::Modeling::ref_vector< boost::any > const &inputs) override
User-implemented function that determines the behavior of this muq::Modeling::WorkPiece.
const unsigned int order
The order of the regression.
std::shared_ptr< IndexedScalarBasis > poly
The polynomial basis (in one variable) used to compute the Vandermonde matrix.
Eigen::MatrixXd ComputeCoefficients(std::vector< Eigen::VectorXd > const &xs, std::vector< Eigen::VectorXd > const &ys) const
Compute the coefficients for the basis functions.
int NumInterpolationPoints() const
Eigen::ArrayXd CenterPoints(std::vector< Eigen::VectorXd > &xs)
Center the input points.
const unsigned int inputDim
The input dimension.
Eigen::MatrixXd ComputeCoefficientsRHS(Eigen::MatrixXd const &vand, std::vector< Eigen::VectorXd > const &ys_data) const
Compute the right hand side given data to compute the polynomial coefficients.
void Fit(std::vector< Eigen::VectorXd > xs, std::vector< Eigen::VectorXd > const &ys, Eigen::VectorXd const ¢er)
Compute the coeffiecents of the polynomial given data.
Eigen::MatrixXd coeff
Coeffients for the polynomial basis.
Regression(boost::property_tree::ptree const &pt)
std::pair< Eigen::VectorXd, double > PoisednessConstant(std::vector< Eigen::VectorXd > xs, Eigen::VectorXd const ¢er, int kn=-1) const
Eigen::MatrixXd VandermondeMatrix(std::vector< Eigen::VectorXd > const &xs) const
Create the Vandermonde matrix.
Eigen::VectorXd currentCenter
Current center of the inputs.
std::shared_ptr< muq::Utilities::MultiIndexSet > multi
The multi-index to so we know the order of each term.
Provides an abstract interface for defining vector-valued model components.
Base class for MUQ's modelling envronment.
The cost function for an optimization routine.
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...