Learn R Programming

mgcv (version 1.6-0)

cSplineDes: Evaluate cyclic B spline basis

Description

Uses splineDesign to set up the model matrix for a cyclic B-spline basis.

Usage

cSplineDes(x, knots, ord = 4)

Arguments

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.

Value

  • A matrix with length(x) rows and length(knots)-1 columns.

Details

The routine is a wrapper that sets up a B-spline basis, where the basis functions wrap at the first and last knot locations.

See Also

cyclic.p.spline

Examples

Run this code
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)

Run the code above in your browser using DataLab