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 );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_linregress( fVector h_Param, fVector d_X, fVector d_Y, ui size );
int cusdVF_linregress( fVector d_Param, fVector d_X, fVector d_Y, ui size );
void VF_linregress( fVector h_Param, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_linregress( h_Param, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_linregress( d_Param, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_linregress( h_Param, h_X, h_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