[R] Numerical Derivatives in R

Tolga Uzuner tolga at coubros.com
Sun Mar 12 17:14:04 CET 2006


Suppose I have an arbitrary function:

arbfun<-function(x) {...}

Is there a robust implementation of a numerical derivative routine in R 
which I can use to take it's derivative ? Something a bit more than 
simple division by delta of the difference of evaluating the function at 
x and x+delta...

Perhaps there is a way to do this using D or deriv but I could not 
figure it out. Trying:

eval(deriv(function(x) arbfun(x),"x"),1)

does not seem to work.


More information about the R-help mailing list