[R] Smoothing Spline Basis Matrix
pinkdd
rubyrd2008 at gmail.com
Mon Mar 1 21:26:30 CET 2010
Thank you. D Sonderegger.
Did you mean use
bs <- bs(X, knots = spl$fit$knot)
H <- predict(bs, X)
Then H should be the matrix for the original data under the smoothing spline
basis?
However, another problem arises, since I need to use H to estimate the
coefficient beta, which involves (H'H)^{-1}. But my matrix (H'H) is
singular, which might be caused by the duplicated data in X. Do you know how
to fix this problem?
Thanks!
D Sonderegger wrote:
>
> I believe that smooth.spline fits a cubic B-spline to the data. So you
> just need to know the knot points (which are returned by smooth.spline as
> spl$fit$knot) and then use the bs() function in the splines library.
>
--
View this message in context: http://n4.nabble.com/Smoothing-Spline-Basis-Matrix-tp1573131p1574225.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list