Hi Fir,
you can alternatively use local regression, implemented in the package locfit,
which can also estimate derivatives:
library(locfit)
attach(cars)
# main fit
fit <- locfit( dist ~ speed )
# fit 1st derivative
fitd <- locfit( dist ~ speed , deriv =1)
# plots...
plot(speed, dist )
lines(fit)
While this doesn't answer your question, I want to let you know that there
is a proposal for a related improvement within R that will let users compute
(numerically) the derivatives, of any order, of a given function inside of
R. In your case, this means that you will write the smooth spline functi
Please learn how to use `RsiteSearch' before posting questions to the list:
RSiteSearch("derivative smooth function")
This should have provided you with plenty of solutions.
Ravi.
Ravi Varadhan, Ph.D.
Assistant Professor,
Di
3 matches
Mail list logo