SandBar: Build derivative penalty matrix or its sparse "root"

SandBarR Documentation

Build derivative penalty matrix or its sparse "root"

Description

Compute order-m derivative penalty matrix \bm{S} or its sparse "root" \bm{K} such that \bm{K'K} = \bm{S}.

Usage

SandBar(xt, d, m)

Arguments

xt

full knot sequence for ordinary B-splines (length(xt) >= 2 * d required).

d

B-spline order (d \ge 2 required).

m

order of the derivative penalty (0 \le m \le d - 1 required).

Details

Build \bm{\bar{S}} in the sandwich formula \bm{S} = \bm{D'\bar{S}D}.

Value

A sparse matrice of "dsCMatrix" (when m < d - 1) or "ddiMatrix" (when m = d - 1) class.

Author(s)

Zheyuan Li zheyuan.li@bath.edu

Examples

require(gps.mgcv)

## example with ordinary B-splines
xt <- c(0, 0, 0, 0, 1, 3, 4, 4, 4, 4)

SandBar(xt, d = 4, m = 2)

ZheyuanLi/gps.mgcv documentation built on Sept. 19, 2024, 9:11 p.m.