Skip to content
Back to formatted view

Raw Message

Message-ID: <1306708098844-3559610.post@n4.nabble.com>
Date: 2011-05-29T22:28:18Z
From: guy33
Subject: Fitting spline using Pspline
In-Reply-To: <79F23BA7BB084E4FA01A8B93904CD02CF67816C1FE@WIGGUMVS.win.ad.jhu.edu>

Ravi,

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:

x=array(0,1000)
y=array(0,1000)
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)))
}
plot(x,y)

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

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


What do you make of that?
-guy33

--
View this message in context: http://r.789695.n4.nabble.com/Fitting-spline-using-Pspline-tp3559202p3559610.html
Sent from the R help mailing list archive at Nabble.com.