powered by
constructs the penalty matrix associated with cubic regression splines basis. This function is called inside crs.
crs
crs.FP(knots, h)
List of two elements:
matrix used in function crs for basis construction
penalty matrix
Numeric vectors that specifies the knots of the splines (including boundaries)
vector of knots differences (corresponds to diff(sort(knots)))
diff(sort(knots))
library(survPen) # construction of the penalty matrix using a sequence of knots knots <- c(0,0.25,0.5,0.75,1) diff.knots <- diff(knots) crs.FP(knots,diff.knots)
Run the code above in your browser using DataLab