I am using "smooth.spline" in R. Here is a snippet from the documentation:
http://stat.ethz.ch/R-manual/R-patched/library/stats/html/smooth.spline.html
smooth.spline {stats} R Documentation
Fit a Smoothing Spline Description Fits a cubic smoothing spline to the supplied data.
Usage smooth.spline(x, y = NULL, w = NULL, df, spar = NULL, cv = FALSE, all.knots = FALSE, nknots = NULL, keep.data = TRUE, df.offset = 0, penalty = 1, control.spar = list(), tol = 1e-6 * IQR(x))
My question is that:
I have two vectors of data x and y, where the lower bound for x is -100 and the upper bound for x is +100.
And I knew that for y=f(x):
f(-100)=-1
f(+100)=+1
That's to say, I would like to have the lower boundary and upper boundary points to be forced passing thru by the cubic spline procedure.
Because these two points are accurate and precise.
How to do that?
Could anybody please help me?
Thanks a lot!
w) to achieve this? – whuber♦ May 29 '12 at 16:40w[x==100] <- 1000andw[x==-100] <- 1000to make sure you're catching all the endpoints in the data. – jbowman May 29 '12 at 18:08