Description Usage Arguments Details Value See Also Examples
This function generates a B-spline density basis of any degree.
1 |
x |
numeric vector for which the B-spline densities are to be generated |
knots |
knots used to generate the B-spline densities |
degree |
positive integer specifying the degree of the B-spline densities (default is 3 for cubic B-splines) |
splineDesign is used to generate a B-spline basis of any degree. Each B-spline is then normalised to become a B-spline density using analytical integration. Note that the two boundary knots (0 and 1) are each coincident degree
+ 1 times.
matrix of the B-spline density basis
splineDesign
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# Generate basis functions
set.seed(1)
x = seq(0, 1, length = 256)
knots = sort(c(0, runif(10), 1))
basis = dbspline(x, knots)
# Plot basis functions
plot(x, basis[1, ], type = "l", ylim = c(min(basis), max(basis)),
ylab = expression(b[3](x)), main = "Cubic B-spline Density Basis Functions")
for (i in 2:nrow(basis)) lines(x, basis[i, ], col = i)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.