writetohana at gmail.com
2015-Nov-13 19:34 UTC
[R] R setting number of knots in smoothing splines
Dear all, I am solving a problem about setting a knots in function smooth. spline. I am not very sure how to set a knot points in this. I understand it accept only number of points, but not distances between them. Can you help me how to specify the distances? Thanks a lot. Regards! [[alternative HTML version deleted]]
1. I am not an expert on smoothing splines, but what you are trying to do seems unwise. See e.g. Chapter 5 of Hastie et. al. "The Elements of Statistical Learning." 2. However, could you not do what you want by setting some of the weights, w, to 0? Cheers, Bert Bert Gunter Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Fri, Nov 13, 2015 at 11:34 AM, <writetohana at gmail.com> wrote:> Dear all, > > > I am solving a problem about setting a knots in function smooth. spline. I am not very sure how to set a knot points in this. I understand it accept only number of points, but not distances between them. Can you help me how to specify the distances? > > > Thanks a lot. > > Regards! > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On 13/11/2015 2:34 PM, writetohana at gmail.com wrote:> Dear all, > > > I am solving a problem about setting a knots in function smooth. spline. I am not very sure how to set a knot points in this. I understand it accept only number of points, but not distances between them. Can you help me how to specify the distances?smooth.spline (you really shouldn't be using HTML to post; then the function name wouldn't get messed up) chooses evenly spaced quantiles in x for the knots. Normally the result if you choose every unique x won't be much different: it's the "df" or "spar" parameter that controls the result much more than the knots. So I'd say you should read more about smoothing splines before you continue with your approach. Duncan Murdoch> > > Thanks a lot. > > Regards! > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >