powered by
Generate basis matrix for a periodic B-spline using pbs::pbs().
pbs::pbs()
getSplineBasis(x, period, nKnots, intercept)
A matrix with a row for each value of x and a column for each component of the decomposition.
x
Values of the predictor variable.
Period for the predictor variable.
Number of internal knots.
If TRUE, a column of ones will be included in the basis.
TRUE
b = getSplineBasis(seq(0, 20, 4), period = 24, nKnots = 3, intercept = FALSE)
Run the code above in your browser using DataLab