bSpline: B-Splines bases

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ppstat.R

Description

bSpline computes the B-spline basis matrix.

Usage

1
bSpline(x, knots, ..., sym = FALSE, trunc = NULL, levels = NULL)

Arguments

x

a numeric vector. The predictor variable.

knots

a numeric vector. The knots or breakpoints that define the spline basis. If levels is not NULL this argument specifies the range of the knots for a multiscale B-spline basis.

sym

a logical. Should the basis functions be symmetric around 0. Default value is FALSE.

trunc

a numeric of length 1 or 2. The spline basis is truncated below trunc or to the interval from trunc[1] to trunc[2] if trunc has length 2. Default value is NULL, which means no truncation.

levels

a positive integer specifying the number of levels in a multiscale model using splines. Default value is NULL, which means no multiscale modeling.

...

additional arguments passed to splineDesign, for instance, ord which gives the order of the spline functions, see splineDesign.

Details

bSpline is a convenience wrapper function for splineDesign as an alternative to bs. It has defaults and some useful parameters suitable for formula specification of linear filter function bases when using pointProcessModel.

The function also provides a computation of a multiscale B-spline basis using the levels argument. If levels is not NULL a sequence of bases are used with different scales. Only the range of the knots argument is used. With n levels the total number of equidistant knots is 2^n * 4 + 2 * n + 1. The k'th level (for k > 1) uses every 2^(n-k+1) knot.

Value

A matrix of basis function evaluations. Zero-columns returned from splineDesign are discarded.

Author(s)

Niels Richard Hansen, Niels.R.Hansen@math.ku.dk

See Also

splineDesign, bs, pointProcessModel

Examples

1
2
3
bSpline(seq(1,10), 2:8)
bSpline(seq(-10,10), 2:8, sym = TRUE)
bSpline(seq(-10,10), seq(-10,10,2), trunc = c(-4,4))

ppstat documentation built on May 2, 2019, 5:26 p.m.