Re: [R] Fitting spline using Pspline

From: guy33 <>
Date: Sun, 29 May 2011 15:28:18 -0700 (PDT)


Thanks so much! You're right, smooth.spline does work on larger n.

Although, for some reason it's results are different (slightly less good?, but I'm not sure). For example, on the simple doppler function below, sm.spline seems to be closer to the true function than smooth.spline:

for (i in 1:1000){

	x[i] = i/1000
	y[i] = (x[i]*(1-x[i]))^.5 * sin(2*pi*(1.05/(x[i]+.05)))

fit = sm.spline(x, y, norder=2, cv=FALSE) lines(fit$x,fit$y)

fit2 = smooth.spline(x, y, cv=FALSE)

What do you make of that?

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 29 May 2011 - 22:30:17 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 30 May 2011 - 06:10:10 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive