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
|