Regress::LinRegress Function

void LinRegress(TVec *X, TVec *Y, TVec *B, bool Constant = true, TVec *Weights = null, TVec *YCalc = null, TMtx *ATA = null);

Simple linear regression.

#NameTypeDescription
1XTVec *
2YTVec *
3BTVec *
4Constant = truebool
5Weights = nullTVec *
6YCalc = nullTVec *
7ATA = nullTMtx *
Remarks:

The routine fits equations to data by minimizing the sum of squared residuals:

SS = Sum [y(k) - ycalc(k)]^2 ,

where y(k) and ycalc(k) are respectively the observed and calculated value of the dependent variable for observation k. ycalc(k) is a function of the regression parameters b(0) and b(1). In case constant term is used, the observed values obey the following equation:

y(k) = b(0) + b(1) * x

i.e

Y = b(0) + b(1)*X.

or if constant term is NOT used:

y(k) = b(0) * x

To calculate additional regression statistical parameters, use Regress::RegressTest routine.

See Also: Regress::MulLinRegress, Regress::RegressTest
Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler