bspline: B-spline specification

View source: R/bspline.R

bsplineR Documentation

B-spline specification

Description

bspline helps define the parameters necessary for constructing a B-spline but doesn't evaluate it.

Usage

bspline(rangeval = 0:1, nbasis, nknots, norder = 4, extend = FALSE, knots)

Arguments

rangeval

A numeric vector of length 2 defining the interval over which the functional data object can be evaulated. The default value is 0:1.

nbasis

An integer specifying the number of basis functions to construct. This is closely linked to the number of knots (nknots), and nknots = nbasis - norder.

nknots

The number of *interior* knots. See Details.

norder

An integer specifying the order of the B-splines, which is one higher than their degree. The default is 4, which corresponds to cubic splines.

extend

Should the knots stop at the endpoints specified by rangeval? Default is FALSE. See Details.

knots

A numeric vector with all knots (interior and exterior), including potentially replicated endpoints. See Details.

Details

The knots are assumed to be equidistant and non-repeating (except possibly at the endpoints).

The number of knots (nknots) and the number of basis function (nbasis) are linked by the relation nknots = nbasis - norder.

If extend = TRUE, the interior knots are augmented by replicating the rangeval endpoints norder times. Otherwise, the interior knots are augmented by norder knots at each end corresponding to the spacing of the interior knots.

The knot placement mimics the behavior of create.bspline.basis when extend = FALSE. Note that the number of breaks specified by breaks in create.bspline.basis corresponds to the number of interior knots plus 2 (the interior knots plus the two endpoints).

If knots is specified, the function does minimial argument checking. This is provided (mostly) for testing purposes, though it can be used by individuals who want more customizability of knots locations than the equidistant spacing provided by default.

Value

An object of class hero_bspline. It is a list specifying the necessary B-spline parameters.

Author(s)

Joshua French

See Also

knot.design

Examples

bspline(nbasis = 10)

hero documentation built on July 26, 2023, 5:11 p.m.