Numerical gradient for a function at a given value (internal).
grad(func, x, ..., method=c("fast","richardson"))
A vector if func(x) has length 1, otherwise a matrix with rows for x and columns for func(x).
Function taking a vector argument x (returns a vector of length>=1)
vector of arguments for where the gradient is wanted.
other arguments to the function
string argument to determine whether to use the fast two sided calculation or use a Richardson extrapolation.
Mark Clements.
(func(x+delta,...)-func(x-delta,...))/(2 delta) where delta is the third root of the machine precision times pmax(1,abs(x)).
numDelta()