Dear All,
I tried following for getting derivative of a polynomial in R

i<- -10:10
x<-i*i*i+3*i*i+2
fun_spline<-splinefun(i,x)
plot(x,type="l")
lines(x,fx_spline(x, deriv=1), col='green')
lines(x,fx_spline(x, deriv=2), col='green')

Now when I plot
3*i*i + 6*i and 6*i + 6
the plot was not same for first deivative.
where as the 2nd derivative was same

Is this a correct method for getting derivative.
where am I doing wrong as first derivative  lines(x,fx_spline(x,
deriv=1), col='green') is not correct.

amar
--
Amar Kumar Nandan

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to