Learn R Programming

hero (version 0.6)

diffpen: P-spline difference penalty

Description

P-spline difference penalty

Usage

diffpen(x, m = 2, sparse = TRUE)

Value

A matrix or sparseMatrix-class object.

Arguments

x

A hero_bspline object produced by bspline.

m

A positive integer indicating order of the difference penalty.

sparse

A logical value indicating if the result should be a sparse version of the Matrix-class.

Author

Joshua French

Examples

Run this code
b = bspline(nbasis = 10)
diffpen(b)

Run the code above in your browser using DataLab