Learn R Programming

SEL (version 1.0-4)

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

Description

Calculates the knot averages of a B-spline basis.

Usage

knotave(knots, d)

Value

Numeric containing knot averages

Arguments

knots

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

d

Degree of the B-spline basis.

Author

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

Run this code
## 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

Run the code above in your browser using DataLab