Learn R Programming

sommer (version 4.3.5)

bbasis: Function for creating B-spline basis functions (Eilers & Marx, 2010)

Description

Construct a B-spline basis of degree deg with ndx-1 equally-spaced internal knots (ndx segments) on range [x1,xr]. Code copied from Eilers & Marx 2010, WIR: Comp Stat 2, 637-653.

Usage

bbasis(x, xl, xr, ndx, deg)

Value

A matrix with columns holding the P-spline for each value of x. Matrix has ndx+deg columns and length(x) rows.

Arguments

x

A vector. Data values for spline.

xl

A numeric value. Lower bound for data (lower external knot).

xr

A numeric value. Upper bound for data (upper external knot).

ndx

A numeric value. Number of divisions for x range (equal to number of segments = number of internal knots + 1)

deg

A numeric value. Degree of the polynomial spline.

Details

Not yet amended to coerce values that should be zero to zero!