Re: [R] Smoothing Spline Basis Matrix

2010-03-01 Thread pinkdd
Thanks, Derek. I used your code, but H still has a lot of columns being 0. I'm not sure why. I'm dealing the data http://www-stat.stanford.edu/~tibs/ElemStatLearn/ with X=age, Y=spnbmd I think X has too many duplicated data??? I'll check the book you recommended in the library tomorrow. Thanks

Re: [R] Smoothing Spline Basis Matrix

2010-03-01 Thread pinkdd
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)^{-

[R] Smoothing Spline Basis Matrix

2010-03-01 Thread pinkdd
Anybody knows how to generate the basis matrix for smoothing spline? And how about the smoother matrix? I tried to use the following code, but there exist replicated data in X, and the length of smooth.spline(X, S[,i])$y is smaller than X, and then there is error in the last step. spl <- smoot