[R] trouble with predict.smooth.Pspline
Martin Renner
h95mr at mun.ca
Sat Mar 29 00:02:47 CET 2003
I have problems getting predict.smooth.Pspline (part of the pspline
package) to work. Here's an example on artificial data:
########start#########
library (Pspline)
tt <- seq (0,1,length=20)
xt <- tt^3
fit <- smooth.Pspline (tt, xt, norder=3,df=4, method=2)
fit <- smooth.Pspline (tt, xt, norder=3,spar=0.0001, method=1)
plot (tt,xt)
lines(fit) # so far everything works fine - looks fine at least
predict.smooth.Pspline (fit, tt, nderiv=0)[,1]
####### end ##########
This produces only 20x NaN instead of something similar to xt
At the end I'm trying to get 2nd derivatives of quintic spline fits.
Does anybody know how to get predict.smooth.Pspline or is there
another way to do this? Any help would be greatly appreciated. Cheers,
Martin
More information about the R-help
mailing list