[R] numericDeriv

Paul Gilbert pgilbert at bank-banque-canada.ca
Fri Apr 30 20:19:29 CEST 2004

Jean Eid wrote:

>Dear All,
>I am trying to solve a Generalized Method of Moments problem which
>necessitate the gradient of moments computation to get the
>standard  errors of estimates.
>I know optim does not output the gradient, but I can use numericDeriv to
>get that. My question is: is this the best function to do this?
'Best' depends on what you want. If you want an accurate numerical 
estimate of the gradient then you might look at the program 
gradRichardson in the curve package of the dseplus bundle in the devel 
area of CRAN. It uses Richarson extrapolation to improve the accuracy. 
However, this is not the program to use if you want a quick numerical 
estimate of the gradient. Most anything else you might think of using 
will be quicker.

There are some other programs around too. A year or two ago there was 
some discussion of putting various gradient calculation techniques 
together in one place. I don't  think anything has happen yet.

Paul Gilbert

More information about the R-help mailing list