[R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
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

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
Thanks Dennis. I got you. My main consern was how to differentiate a series correctly. I think the first procedure is more accurate. Regards. On 27 May 2011 16:27, Dennis Murphy djmu...@gmail.com wrote: Hi: A function and its spline approximation are not equivalent functions, hence neither

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
However if we have some discrete data set like daily temperature etc how can we can differentiate it because as.expression(D()) will not work then On 27 May 2011 16:52, nandan amar nandan.a...@gmail.com wrote: Thanks Dennis. I got you. My main consern was how to differentiate a series

Re: [R] finding derivative of a data series in R

2011-05-27 Thread Ravi Varadhan
derivative of a data series in R However if we have some discrete data set like daily temperature etc how can we can differentiate it because as.expression(D()) will not work then On 27 May 2011 16:52, nandan amar nandan.a...@gmail.com wrote: Thanks Dennis. I got you. My main consern was how

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of nandan amar Sent: Friday, May 27, 2011 10:44 AM To: r-help; Dennis Murphy Subject: Re: [R] finding derivative of a data series in R However if we have some discrete data set like daily temperature etc how can we can differentiate