[R] Derivative of nonparametric curve

Liaw, Andy andy_liaw at merck.com
Wed Sep 9 13:42:32 CEST 2009


From: Rolf Turner
> 
> On 8/09/2009, at 9:07 PM, FMH wrote:
> 
> > Dear All,
> >
> > I'm looking for a way on computing the derivative of first and  
> > second order of a smoothing curve produced by a nonprametric  
> > regression. For instance, if we run the R script below, a smooth  
> > nonparametric regression curve is produced.
> >
> > provide.data(trawl)
> > Zone92   <- (Year == 0 & Zone == 1)
> > Position <- cbind(Longitude - 143, Latitude)
> > dimnames(Position)[[2]][1] <- "Longitude - 143"
> > sm.regression(Longitude, Score1, method = "aicc", col = "red",   
> > model = "linear")
> >
> > Could someone please give some hints on the way to find the  
> > derivative on the curve at some points ?
> 
> See
> 
> 	?smooth.spline
> and
> 	?predict.smooth.spline

Since sm.regression() (from the sm package, I presume) uses kernel
methods, a kernel-based estimator of derivatives is available in the
KernSmooth package.

Andy
 
> 	cheers,
> 
> 		Rolf Turner
> 
> ######################################################################
> Attention:\ This e-mail message is privileged and 
> confid...{{dropped:9}}
> 
> ______________________________________________
> 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.
> 
Notice:  This e-mail message, together with any attachme...{{dropped:12}}




More information about the R-help mailing list