Learn R Programming

pomp (version 0.21-3)

B-splines: B-spline bases

Description

These functions generate B-spline basis functions as lookup tables. bspline.basis gives a set of basis functions. periodic.bspline.basis gives a basis of periodic spline functions.

Usage

bspline.basis(x, degree = 3, knots)
periodic.bspline.basis(x, nbasis, degree = 3, period = 1)

Arguments

x
Vector at which the spline functions are to be evaluated.
degree
Degree of requested B-splines.
knots
Vector of positions of the knots.
nbasis
The number of basis functions to return.
period
The period of the requested periodic B-splines.

Value

  • bspline.basisReturns a matrix with length(x) rows and nbasis=length(knots)-degree-1 columns. Each column contains the values one of the nbasis spline functions.
  • periodic.bspline.basisReturns a matrix with length(x) rows and nbasis columns.

Examples

Run this code
x <- seq(-0.2,1.2,by=0.01)
y <- bspline.basis(x,degree=7,seq(0,1,length=14))
matplot(x,y)

x <- seq(-1,2,by=0.01)
y <- periodic.bspline.basis(x,nbasis=5)
matplot(x,y)

Run the code above in your browser using DataLab