Re: [R] Numerical Derivative / Numerical Differentiation of unknown funct ion

From: Paul Gilbert <pgilbert_at_bank-banque-canada.ca>
Date: Sat 07 May 2005 - 07:33:45 EST

A current version of this code is in the dseplus bundle in the devel section of CRAN. It does Richardson's extrapolation, which gives an accurate numerical estimate at the expense of speed. (It does a very large number of function evaluations.) That may not be what you want.

Paul Gilbert

Uzuner, Tolga wrote:

>Hi,
>
>I have been trying to do numerical differentiation using R.
>
>I found some old S code using Richardson Extrapolation which I managed to get
>to work.
>
>I am posting it here in case anyone needs it.
>
>
>########################################################################
>richardson.grad <- function(func, x, d=0.01, eps=1e-4, r=6, show=F){
># This function calculates a numerical approximation of the first
># derivative of func at the point x. The calculation
># is done by Richardson's extrapolation (see eg. G.R.Linfield and
>J.E.T.Penny
># "Microcomputers in Numerical Analysis"). The method should be used if
># accuracy, as opposed to speed, is important.
>#
># * modified by Paul Gilbert from orginal code by XINGQIAO LIU.
>...
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat May 07 08:02:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:37 EST