bscpp | R Documentation |
Computes the B-spline basis matrix for a given polynomial spline.
bscpp(
x = NA_real_,
df = NA_integer_,
knots = NA_real_,
degree = 3L,
intercept = 0L,
boundary_knots = NA_real_,
warn_outside = 1L
)
x |
A numeric vector representing the predictor variable. |
df |
Degrees of freedom, specifying the number of columns in the
basis matrix. If |
knots |
A numeric vector specifying the internal breakpoints
that define the spline. If not provided, |
degree |
An integer specifying the degree of the piecewise
polynomial. The default value is |
intercept |
A logical value indicating whether to include an
intercept in the basis. The default is |
boundary_knots |
A numeric vector of length 2 specifying the
boundary points where the B-spline basis should be anchored.
If not supplied, the default is the range of non-missing values
in |
warn_outside |
A logical value indicating whether a warning
should be issued if any values of |
A matrix with dimensions c(length(x), df)
. If
df
is provided, the matrix will have df
columns.
Alternatively, if knots
are supplied, the number of columns
will be length(knots) + degree + intercept
. The matrix
contains attributes that correspond to the arguments
passed to the bscpp
function.
Kaifeng Lu, kaifenglu@gmail.com
bscpp(women$height, df = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.