Re: [R] differentiating a numeric vector

2008-03-06 Thread Levi Waldron
Thanks for all the ideas. splinefun looks like the simplest way to achieve what I need: > x <- 1:10 > y <- x^2 > f <- splinefun(x,y) > f(3,deriv=0) [1] 9 > f(3,deriv=1) [1] 6 > f(3,2) [1] 2 > f(3,3) [1] -3.330669e-16 The fda package has a function bsplineS which does nearly the same thing, and t

Re: [R] differentiating a numeric vector

2008-03-05 Thread Ravi Varadhan
ECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ravi Varadhan Sent: Wednesday, March 05, 2008 4:58 PM To: 'Spencer Graves'; 'Levi Waldron' Cc: 'R-help mailing list' Subject: Re: [R] differentiating a numeric vector Hi, Here is another approach, in addition to the suggest

Re: [R] differentiating a numeric vector

2008-03-05 Thread Ravi Varadhan
ROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Spencer Graves Sent: Wednesday, March 05, 2008 4:11 PM To: Levi Waldron Cc: R-help mailing list Subject: Re: [R] differentiating a numeric vector Have you looked at the 'fda' package? It has many functions for doing what you want. A str

Re: [R] differentiating a numeric vector

2008-03-05 Thread Gabor Grothendieck
Check out ?splinefun On Wed, Mar 5, 2008 at 3:18 PM, Levi Waldron <[EMAIL PROTECTED]> wrote: > What functions exist for differentiating a numeric vector (in my case > spectral data)? That is, experimental data without an analytical > function. ie, > > > x <- seq(1,10,0.1) > > y=x^3+rnorm(length

Re: [R] differentiating a numeric vector

2008-03-05 Thread Spencer Graves
Have you looked at the 'fda' package? It has many functions for doing what you want. A strength is that it is a companion package for two books on that and related issues, and includes script files under "~R.installation.directory\library\fda\scripts" to reproduce some of the analyses.