bsbases: B-spline bases

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/RcppExports.R

Description

Evaluate the B-spline basis function at the x value(s).

Usage

1
bsbases(x, knots, ord)

Arguments

x

Numerical value or vector. The value(s) at which to evaluate the B spline bases.

knots

Numerical vector. The knot positions/sites of the B-spline bases.

ord

An integer >=1. The order of the B-spline bases. Equals degree plus 1.

Value

A numerical matrix of length(x) rows and length(knots)-ord columns.

Note

In contrast to the implementation based on the splineDesign function from the splines package, this version of the B-spline basis functions are left-continuous at the rightmost knot.

Author(s)

Feng Chen <feng.chen@unsw.edu.au>

References

de Boor, C. (2001) A Practical Guide to Splines. Revised Edition. Springer: New York.

See Also

splineDesign

Examples

1
2
3
kns <- c(rep(0,4),1:4*0.2,rep(1,4))
round(bsbases(0:5/5,kns,2),10)
round(splines::splineDesign(kns,0:5/5,2),10)

ibs documentation built on May 2, 2019, 11:26 a.m.