You are here: Symbol Reference > Regress Namespace > Types > Regress.TMultiRegressFun Type
Stats Master VCL
ContentsIndex
Example 1

Some examples of regression function: Polynomial of 2nd degree (parabola)

// y=b0*x*x + b1*x + b2
procedure SimpleParabola(const B: TVec; const X: TVecList; const y: TVec);
begin
   y.Sqr(x[0]);
   y.Scale(b[0]); //y = b[0]*sqr(x)
   y.AddScaled(x[0], b[1]);  //y = y + x*b[1];
   y.Add(b[2]);
end;
void __fastcall SimpleParabola(TVec * const b, TVecList * const x, TVec * const y)
{
   double* B = b->PValues1D(0);

   y->Sqr(x[0]);
   y->Scale(B[0]); //y = b[0]*sqr(x)
   y->AddScaled(x[0], B[1]);  //y = y + x*b[1];
   y->Add(B[2]);
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.