Create an M-spline survival model, both structure and parameters.
Source:R/mspline_init.R
msplinemodel_init.Rdmspline_init is first used to create the M-spline
model structure, including knot positions. Parameters including
basis coefficients and scale are either supplied or set to a
default that defines a constant hazard model.
Usage
msplinemodel_init(
df = 10,
degree = 3,
bsmooth = TRUE,
knots = NULL,
bknot = 10,
obstimes = NULL,
coefs = NULL,
hscale = 1
)Arguments
- 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.- degree
Spline polynomial degree. Can only be changed from the default of 3 if
bsmoothisFALSE.- bsmooth
If
TRUEthen the function is constrained to also have zero derivative and second derivative at the boundary.- 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.
- obstimes
Vector of observation times whose quantiles will be used to choose knot locations
- coefs
Basis coefficients
- hscale
Hazard scale parameter
Value
A list defining the M-spline, with any omitted list
components set to defaults. See mspline_init for
details. The parameters are included as the coefs and
hscale components.