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
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)^{-
Close, but not quite. Your design matrix is:
H <- bs(X, knots=spl$fit$knot, intercept=TRUE)
So long as you have data in all of the inter-knot regions, you should be ok.
A good book to check out about this sort of thing is Ruppert, Wand and
Carroll's Semiparametric Regression book. I can't reco
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.
pinkdd wrote:
>
> Anybody knows how to generate the basis matrix for smoothing s
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
5 matches
Mail list logo