RegModels::FracFit Function

void FracFit(TVec *B, TVec *X, TVec *Y, int DegNom, int DegDenom, bool Constant = false, TVec *Weights = null);

Fits rational fraction equation to data.

#NameTypeDescription
1BTVec *Returns regression coefficients for rational function.
2XTVec *Vector of independent variable.
3YTVec *Vector of dependent variable.
4DegNomintNominator degree.
5DegDenomintDenominator degree.
6Constant = falseboolIf false, B[0] i.e. constant term in nominator is set to 0.0.
7Weights = nullTVec *Weights (optional). Weights are used only if they are set.
Remarks:

The routine fits equations to data by minimizing the sum of squared residuals. The observed values obey the following equation:

Y=b[0]+b[1]X+b[2]X2++b[n]Xn1+b[n+1]X++b[n+d]XdY = \cfrac{b[0]+b[1]\cdot X + b[2]\cdot X^2 +\cdots + b[n]\cdot X^{n}}{1+b[n+1]\cdot X + \cdots + b[n+d]\cdot X^{d}}

where n and d are nominator and denominator polynomial degrees.

See Also: RegModels::FracEval
Declared in Dew::Stats::Units::RegModels · Dew.Stats/Units.RegModels.h · Cross-compiler