Get basis for an illustration of an M-spline with given knots.
Source:R/mspline_plots.R
mspline_plotsetup.RdGet basis for an illustration of an M-spline with given knots.
Usage
mspline_plotsetup(
knots,
bknot = 10,
tmin = NULL,
tmax = NULL,
degree = 3,
df = 10,
bsmooth = TRUE
)Arguments
- knots
Vector of knot locations. If not supplied,
dfhas to be specified. One of two rules is then used to choose the knot locations. Ifbknotis specified, a set of equally spaced knots between zero andbknotis used. Otherwise ifobstimesis supplied, the knots are chosen as equally spaced quantiles ofobstimes.The number of knots (excluding zero) is
df - degree + 1ifbsmoothisTRUE, ordf - degree - 1otherwise.- bknot
Location of the final spline knot.
- tmin
Minimum plotting time. Defaults to zero.
- tmax
Maximum plotting time. Defaults to the highest knot.
- degree
Spline polynomial degree. Can only be changed from the default of 3 if
bsmoothisFALSE.- df
Desired number of basis terms, or "degrees of freedom" in the spline. If
knotsis not supplied, the number of knots is then chosen to satisfy this.- bsmooth
If
TRUEthen the function is constrained to also have zero derivative and second derivative at the boundary.
Value
Data frame containing the basis, as returned by mspline_basis.