knotave: Calculate the knot averages of a B-spline basis.

View source: R/SEL.R

knotaveR Documentation

Calculate the knot averages of a B-spline basis.

Description

Calculates the knot averages of a B-spline basis.

Usage

  knotave(knots, d)

Arguments

knots

Knot Vector (with d+1 coincident knots on the boundaries).

d

Degree of the B-spline basis.

Value

Numeric containing knot averages

Author(s)

Bjoern Bornkamp

References

Bornkamp, B. and Ickstadt, K. (2009). A Note on B-Splines for Semiparametric Elicitation. The American Statistician, 63, 373–377

Dierckx, P. (1993), Curve and Surface Fitting with Splines, Clarendon Press

See Also

SEL

Examples

## Example for calculation of a control polygon
knts <- c(rep(0, 4), rep(1, 4))
cf <- c(-1, -1, 1/2, 0)
sq <- seq(0, 1, length = 101)
N <- splineDesign(sq, knots = knts, ord = 4)
res <- colSums(t(N)*cf)
plot(sq, res, type = "l", ylim = c(-1, 0.6))
kntAv <- knotave(knts, 3)
lines(kntAv, cf, col = "red") # add control polygon

SEL documentation built on Nov. 25, 2023, 5:09 p.m.