knot.design: Design knot/breakpoint spacing

View source: R/knot.design.R

knot.designR Documentation

Design knot/breakpoint spacing

Description

See Details of bspline for additional information about arguments.

Usage

knot.design(
  rangeval = 0:1,
  nbasis,
  nknots,
  norder = 4,
  extend = FALSE,
  interior = FALSE
)

knot_design(
  rangeval = 0:1,
  nbasis,
  nknots,
  norder = 4,
  extend = FALSE,
  interior = FALSE
)

knotDesign(
  rangeval = 0:1,
  nbasis,
  nknots,
  norder = 4,
  extend = FALSE,
  interior = FALSE
)

KnotDesign(
  rangeval = 0:1,
  nbasis,
  nknots,
  norder = 4,
  extend = FALSE,
  interior = FALSE
)

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.

interior

A logical value specifying whether only interior knots should be returned. Default is FALSE.

Value

An ascending sequence of univarite knot locations.

Examples

if (requireNamespace("fda", quietly = TRUE)) {
b = fda::create.bspline.basis(nbasis = 10)
# interior knots only
bknots = b$params
# should match
knots = knot.design(nbasis = 10, interior = TRUE)
all.equal(bknots, knots)
}

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