cSplineDes {mgcv} | R Documentation |
Uses splineDesign
to set up the model matrix for a cyclic B-spline basis.
cSplineDes(x, knots, ord = 4)
x |
covariate values for smooth. |
knots |
The knot locations: the range of these must include all the data. |
ord |
order of the basis. 4 is a cubic spline basis. Must be >1. |
The routine is a wrapper that sets up a B-spline basis, where the basis functions wrap at the first and last knot locations.
A matrix with length(x)
rows and length(knots)-1
columns.
Simon N. Wood simon.wood@r-project.org
x <- 0:100/100;k<- 0:5/5 X <- cSplineDes(x,k) plot(x,X[,1],type="l"); for (i in 2:5) lines(x,X[,i],col=i)