Learn R Programming

pomp (version 0.45-8)

B-splines: B-spline bases

Description

These functions generate B-spline basis functions. bspline.basis gives a basis of spline functions. periodic.bspline.basis gives a basis of periodic spline functions.

Usage

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

Arguments

Value

  • bspline.basisReturns a matrix with length(x) rows and nbasis columns. Each column contains the values one of the spline basis functions.
  • periodic.bspline.basisReturns a matrix with length(x) rows and nbasis columns. The basis functions returned are periodic with period period.

Details

Direct access to the underlying C routines is available. See the header file pomp.h for details.

Examples

Run this code
x <- seq(0,2,by=0.01)
y <- bspline.basis(x,degree=3,nbasis=9,names="basis")
matplot(x,y,type='l',ylim=c(0,1.1))
lines(x,apply(y,1,sum),lwd=2)

x <- seq(-1,2,by=0.01)
y <- periodic.bspline.basis(x,nbasis=5,names="spline%d")
matplot(x,y,type='l')

Run the code above in your browser using DataLab