Polynoms::PolyFit Function

Overload List

#SignatureDescription
1void PolyFit(TVec *XValues, TVec *YValues, int Degree, TVec *Coeff, TMtx *R, int &DegFreedom, double &L2R, TVec *Weights = null);Fits a polynomial to data.
2void PolyFit(TVec *XValues, TVec *YValues, int Degree, TVec *Coeff, TVec *Weights = null);Fits a polynomial to data.

Overload 1: void PolyFit(TVec *XValues, TVec *YValues, int Degree, TVec *Coeff, TMtx *R, int &DegFreedom, double &L2R, TVec *Weights = null);

Fits a polynomial to data.

#NameTypeDescription
1XValuesTVec *Defines x values in p=p(x).
2YValuesTVec *Defines polynomial, evaluated at x i.e p(x).
3DegreeintDefines polynomial degree.
4CoeffTVec *Returns the coeficients of fitted polynomial.
5RTMtx *Returns the Cholesky factor of the Vandermonde matrix.
6DegFreedomint &Returns the degree of freedom.
7L2Rdouble &Returns the L2 norm of the residuals.
8Weights = nullTVec *If not nil, defines fitting weights.
Remarks:

The PolyFit procedure uses the least-squares method to find the fitted polynomial coefficients.

Declared in Dew::Math::Units::Polynoms · Dew.Math/Units.Polynoms.h · Cross-compiler

Overload 2: void PolyFit(TVec *XValues, TVec *YValues, int Degree, TVec *Coeff, TVec *Weights = null);

Fits a polynomial to data.

#NameTypeDescription
1XValuesTVec *
2YValuesTVec *
3Degreeint
4CoeffTVec *
5Weights = nullTVec *
Remarks:

This overload does not return additional statistical parameters like Cholesky matrix or degrees of freedom.

Declared in Dew::Math::Units::Polynoms · Dew.Math/Units.Polynoms.h · Cross-compiler