powered by
P-spline difference penalty
diffpen(x, m = 2, sparse = TRUE)
A matrix or sparseMatrix-class object.
matrix
sparseMatrix-class
A hero_bspline object produced by bspline.
hero_bspline
bspline
A positive integer indicating order of the difference penalty.
A logical value indicating if the result should be a sparse version of the Matrix-class.
Matrix-class
Joshua French
b = bspline(nbasis = 10) diffpen(b)
Run the code above in your browser using DataLab