s-news
[Top] [All Lists]

Re: second derivatives calculation

To: vito muggeo <vitomuggeo@hotmail.com>
Subject: Re: second derivatives calculation
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
Date: Thu, 26 Jul 2001 13:24:19 +0100 (GMT Daylight Time)
Cc: <s-news@wubios.wustl.edu>
In-reply-to: <F250hGD1XyCTr9rf3yX0000661b@hotmail.com>
On Thu, 26 Jul 2001, vito muggeo wrote:

> Hi all,
> I used the following code to get the value of myfn() and its first
> derivatives
> at x=10 with K=2 and U=3, for istance
>
> myfn<-deriv(~K*x+U*x/K, c("K","U"), function(x,K,U){})
> K<-2; U<-3
> myfn(10,K,U)
>
> Is there any way to calculate also the second (and maybe third, fourth,...)
> derivatives of myfn()?
> Thanks,
> vito

library(MASS)
myfn <- deriv3(~K*x+U*x/K, c("K","U"), function(x,K,U){})

gives you second derivatives.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


<Prev in Thread] Current Thread [Next in Thread>