Unit
Regress
TRegressFun = function(B: TVec; X: TSample): TSample;
| See Also |
|---|
| TDeriveProc |
Polynomial of 2nd degree (parabola)
// y=b0*x*x + b1*x + b2 function SimpleParabola(B: TVec; X: TSample): TSample; begin Result := b[0]*Sqr(x) + b[1]*x + b[2]; end;
double __fastcall SimpleParabola(TVec * b, double x) { double* B = b->PValues(0); return B[0]*x*x + B[1]*x + B[2]; }
private double SimpleParabola(TVec B, double x) { return B[0]*x*x + B[1]*x + B[2]; }
function Eckerle4(B: TVec; X: TSample): TSample; begin Result := B[0]/B[1] * Exp(-0.5*Sqr((X-B[2])/B[1])); end;
double __fastcall Eckerle4(TVec* b, double x) { double* B = b->PValues(0); double sqrterm = (x-B[2])/B[1])*(x-B[2])/B[1]); return B[0]/B[1] * Exp(-0.5*(sqrterm)); }
| Copyright 2008 Dew Research |