Convert a dataset to its b-spline basis set
dat2bsplinemat(x, df = NULL, knots = NULL, degree = 3L,
intercept = FALSE, Boundary.knots = range(x, na.rm = TRUE),
return.deriv = FALSE, as.data.frame = TRUE)
data.frame: Input
Integer: Degrees of freedom. See splines::bSpline
Float, vector: Internal breakpoints. See splines::bSpline
Integer (>0): Degree of the piecewise polynomial. See splines::bSpline
Logical: If TRUE, an intercept is included. Default = FALSE
Float, vector (length = 2): Boundary points to anchor the spline basis.
Logical: If TRUE, return list containing a data frame with the splines and another data frame with their derivatives
Logical: If TRUE, return data.frame, otherwise matrix. Default = TRUE
See splines::bSpline
If return.deriv=F
, a data frame where each original feature is replaced with its basis set or a list,
otherwise a list containing a data frame with splines and a data frame with their derivatives