Dew MtxVec NET
NumericGradRichardson Routine
Summary
Numerical gradient by high precision numerical differentiation.

Unit
MtxIntDiff

Declaration
Procedure NumericGradRichardson(Fun: TRealFunction; Pars: TVec; const Consts: array of TSample; const ObjConst: array of TObject; Grad: TVec);
 Parameter  Description 
Fun Real function of several variables. 
Pars Function variables. 
Consts Array of additional constants which can be used in math formula. 
PConsts Array of additional constants (pointers) which can be used in math formula. 
Grad Returns calculated gradient. If needed, Grad Length and Complex properties are adjusted automatically. 

Description
Calculates the numerical gradient by high precision numerical differentiation. The algorithm uses Richardson extrapolation of three values of the symmetric difference quotient. The gradient step size is defined by GradStepSize global variable. Normally the optimal stepsize depends on seventh partial derivatives of the function. Since they are not available, the initial value for GradientStepSize is:

Exp(Ln(EPS)/7)*0.25,

as suggested by Spellucci.

 See Also 
NumericGradDifference 
BFGS 
ConjGrad 
TGrad 

Copyright 2008 Dew Research
http://www.dewresearch.com