VF_linregressVD_linregressVE_linregress
FunctionLinear regression
Syntax C/C++#include <VFstd.h>
void VF_linregress( fVector Param, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::linregress( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_linregress( Param, X, Y:fVector; size:UIntSize );
DescriptionThe X-Y data are fitted to a straight line y = ax + b; the parameters a and b are determined in such a way that the quantity
h2 = sum( (Yi - y(x=Xi) )2 )
is minimized. Uncertainties da and db are also determined. On output, Param is filled with the 5 elements {a, da, b, db, h2} in the order indicated.
Error handlingnone
Return valuenone
See alsoVF_linregresswW,   VF_corrcoeff,   VF_chi2,   VF_linfit,   VF_nonlinfit

VectorLib Table of Contents  OptiVec home