This is an internal function of package
creates equally-spaced B-splines basis over an abscissa of data within
MortSmooth_bbase(x, xl, xr, ndx, deg)
vector for the abscissa of data.
number of internal knots minus one or number of internal intervals.
degree of the splines.
The function reproduce an algorithm presented by Eilers and Marx
(2010) using differences of truncated power functions (see
MortSmooth_tpower). The final matrix has a single
B-spline for each of the [
deg] columns. The number
of rows is equal to the length of
The function differs from
bs in the package
since it automatically constructed B-splines with identical
shape. This would allow a simple interpretation of coefficients and
application of simple differencing.
A matrix containing equally-spaced B-splines of degree
x for each column.
Carlo G Camarda
Eilers P. H. C. and B. D. Marx (2010). Splines, Knots, and Penalties. Wiley Interdisciplinary Reviews: Computational Statistics. 2, 637-653.
1 2 3 4 5 6 7 8 9
x <- seq(0,1,length=500) ## B-splines basis of degree 1 B1 <- MortSmooth_bbase(x=x, xl=min(x), xr=max(x), ndx=10, deg=1) matplot(x, B1, t="l", main="B-splines basis of degree 1") ## B-splines basis of degree 3 B3 <- MortSmooth_bbase(x=x, xl=min(x), xr=max(x), ndx=10, deg=3) matplot(x, B3, t="l", main="B-splines basis of degree 3")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.