[R] bs() function of the splines package with intercept=FALSE

Eddy G. eddy_lolo at hotmail.com
Tue Jun 14 14:10:03 CEST 2005


Hello,

I'm implementing a function using non uniform B-Splines. Looking at the
code of the bs() function, I realized that if the intercept was set to
FALSE, the behavior of the function was the following (df is the number
of degrees of freedom that I believe can be interpreted as the number
of control points):

- Compute df- ord + 1 _internal_ knots (ord is the order of the spline)
- Add ord times the boundaries values at each extrem of the knots
vector.
- Compute the design matrix on this vector.

This results in a design matrix with df+1 columns. The bs function the
_removes_ the first column of the matrix (resulting as expected in a
matrix with df columns).

I'm a bit confused, does anyone see the mathematical justification of
this manipulation?

Thanks a lot,

Laurent


http://www.imagine-msn.com/hotmail/default.aspx?locale=fr-FR




More information about the R-help mailing list