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.
bbasis(x, xl, xr, ndx, deg)
A matrix with columns holding the P-spline for each value of x.
Matrix has ndx+deg
columns and length(x)
rows.
A vector. Data values for spline.
A numeric value. Lower bound for data (lower external knot).
A numeric value. Upper bound for data (upper external knot).
A numeric value. Number of divisions for x range (equal to number of segments = number of internal knots + 1)
A numeric value. Degree of the polynomial spline.
Not yet amended to coerce values that should be zero to zero!