You are here: Symbol Reference > Regress Namespace > Types > Regress.TDeriveProc Type
Stats Master VCL
ContentsIndex
PreviousUpNext
Regress.TDeriveProc Type

Defines derivatives of a function.

Pascal
TDeriveProc = procedure (RegressFun: TRegressFun; const X, Y: double; const Pars, Grad: TVec);

The type describes the procedure for calculating the derivatives of a regression function TRegressFun with respect to the regression parameters (B array), evaluated at (X,Y).

An example of regression function and it's derivatives with respect to regression parameters:

// y=b0*x*x + b1*x + b2
function SimpleParabola(const B: TVec; X: double): double;
begin
  SimpleParabola := b[0]*Sqr(x) + b[1]*x + b[2];
end;
// grad _b function
procedure SimpleParabolaDeriv(RegressFun: TRegressFun; const X, Y: double; const Pars: TVec; const Grad: TVec);
begin
  Grad[0] := Sqr(x);
  Grad[1] := x;
  Grad[2] := 1;
end;
void __fastcall SimplexParabolaDeriv(TRegresFun* RegressFun, const double x, const double y, TVec* const Pars, TVec* const Grad);
{
  Grad->Values[0] = x*x;
  Grad->Values[1] = x;
  Grad->Values[2] = 1.0;
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!