Dear all, I'm trying to use the Pspline add-on package to fit a quintic spline (norder =3), but I keep running into a Singularity error.> traj.spl <- smooth.Pspline(time, x, norder=3 )Error in smooth.Pspline(time, x, norder = 3) : Singularity error in solving equations>Playing around with the other parameters produces an "unused arguments" error:> traj.spl <- smooth.Pspline(time, x, norder=3 , cv=FALSE, method=3)Error in smooth.Pspline(time, x, norder = 3, cv = FALSE, method = 3) : unused argument(s) (cv ...)>Setting norder=2 doesn't produce an error but summary indicates norder=1.> traj.spl <- sm.spline (time,x, norder=2, cv=FALSE) > summary (traj.spl)Length Class Mode norder 1 -none- numeric x 36 -none- numeric ysmth 36 -none- numeric lev 36 -none- numeric gcv 1 -none- numeric cv 1 -none- numeric df 1 -none- numeric spar 1 -none- numeric call 6 -none- call>Has anybody been able to fit quintic splines with Pspline or has some advise how to avoid the Singularity error? Thank you, Martin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 25 Nov 2002, Martin Renner wrote:> I'm trying to use the Pspline add-on package to fit a quintic spline > (norder =3), but I keep running into a Singularity error. > > > traj.spl <- smooth.Pspline(time, x, norder=3 ) > Error in smooth.Pspline(time, x, norder = 3) : > Singularity error in solving equationstime <- 1:100 x <- rnorm(100) traj.spl <- smooth.Pspline(time, x, norder=3 ) works for me. It's probably something specific to your data. However, the defaults spar=0, method=1 are not sensible: they are asking for a perfect fit. At least try method=3.> Playing around with the other parameters produces an "unused arguments" error: > > > traj.spl <- smooth.Pspline(time, x, norder=3 , cv=FALSE, method=3) > Error in smooth.Pspline(time, x, norder = 3, cv = FALSE, method = 3) : > unused argument(s) (cv ...)?smooth.Pspline does not have argument cv listed for smooth.Pspline, so no wonder it does not work.> Setting norder=2 doesn't produce an error but summary indicates norder=1. > > > traj.spl <- sm.spline (time,x, norder=2, cv=FALSE) > > summary (traj.spl) > Length Class Mode > norder 1 -none- numeric > x 36 -none- numeric > ysmth 36 -none- numeric > lev 36 -none- numeric > gcv 1 -none- numeric > cv 1 -none- numeric > df 1 -none- numeric > spar 1 -none- numeric > call 6 -none- callThat's *length* 1, not value 1. It's also sm.spline not smooth.Pspline. I suspect that if you read the help page accurately you can find ways to do what you want. I suggest starting with the defualt settings of sm.spline until you understand those of smooth.Pspline. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The mgcv and gss packages will both let you fit higher order splines (penalized regression splines in mgcv and full splines in gss). In mgcv it's something like: time <- 1:100 x <- rnorm(100) gam(x~s(time,m=3)) # default basis dimension 10 p.r. spl. gam(x~s(time,m=3,k=100)) # use full smoothing spl. (the latter is not a good idea if number of data is large!) Simon ______________________________________________________________________> Simon Wood snw at st-and.ac.uk http://www.ruwpa.st-and.ac.uk/simon.html > CREEM, The Observatory, Buchanan Gardens, St Andrews, Fife KY16 9LZ UK > Direct telephone: (0)1334 461844 Indirect fax: (0)1334 463748> Dear all, > > I'm trying to use the Pspline add-on package to fit a quintic spline > (norder =3), but I keep running into a Singularity error. > > > traj.spl <- smooth.Pspline(time, x, norder=3 ) > Error in smooth.Pspline(time, x, norder = 3) : > Singularity error in solving equations > > > > Playing around with the other parameters produces an "unused arguments" error: > > > traj.spl <- smooth.Pspline(time, x, norder=3 , cv=FALSE, method=3) > Error in smooth.Pspline(time, x, norder = 3, cv = FALSE, method = 3) : > unused argument(s) (cv ...) > > > > Setting norder=2 doesn't produce an error but summary indicates norder=1. > > > traj.spl <- sm.spline (time,x, norder=2, cv=FALSE) > > summary (traj.spl) > Length Class Mode > norder 1 -none- numeric > x 36 -none- numeric > ysmth 36 -none- numeric > lev 36 -none- numeric > gcv 1 -none- numeric > cv 1 -none- numeric > df 1 -none- numeric > spar 1 -none- numeric > call 6 -none- call > > > > Has anybody been able to fit quintic splines with Pspline or has some > advise how to avoid the Singularity error? > > Thank you, > Martin > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._