[R] evaluating derivative matrices of spline functions

Spencer Graves spencer.graves at structuremonitoring.com
Fri Feb 24 22:14:24 CET 2012


       I don't know about "smooth.spline", but the "fda" package 
includes "deriv.fd".  It also includes "eval.fd" and "predict.fd".  If 
you only want a first derivative, then differentiating a standard cubic 
spline may be adequate.  However, the first derivative of a cubic spline 
is a quadratic spline, the second derivative is a linear spline, and the 
third derivative is a step function.  The "fda" package provides more 
alternative basis sets than the standard cubic splines, and may give you 
results more to your liking.


       Hope this helps.
       Spencer


p.s.  Full disclosure:  I'm the third author on the Springer "Use R!" 
book on "Functional Data Analysis with R and Matlab".  I was the R 
expert on the team that produced that book.  The lead author, Jim 
Ramsay, invented "functional data analysis" as a generalization of 
spline smoothing to (a) bases other than the standard cubic b-splines 
and (b) penalty functions other than the standard integral of the square 
of the second derivative.


On 2/24/2012 12:33 PM, Vassily Shvets wrote:
> Hello,
> I've noticed that SPLUS has a function for evaluating the derivative matrices of splines.
> I've also noticed that there's a function in R for evaluating matrices from smooth.spline;
> maybe someone knows if something has been written to evaluate matrices from 'smooth.basis'?
> regards,
> s
>
> ______________________________________________
> R-help at 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.


-- 
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com



More information about the R-help mailing list