controlPolygon: Control polygon of a spline

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

Description

The control polygon matches running means of k knots with the spline coefficients, where k = the degree of the knots. See Dierckx(p. 20).

Usage

1

Arguments

object

an object of class 'dierckx' or 'fd'

Details

Dierckx(p. 20-22, including Figure 1.2) explains how the control polygon can help isolate the zeros of a spline.

Value

An array of dimension nbasis x 2, where the first column contains running means of k knots, and the second is the coefficients of the spline.

Author(s)

Spencer Graves

References

Dierckx, P. (1993) Curve and Surface Fitting with Splines, Oxford Science Publications.

See Also

curfit, fd

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# spline object of Figure 1.2
knots1.2 <- c(0,0,0,0, 2, 4, 7, 8, 10,10,10,10)
wts <- c(1, 2, 5, -5, 5, -1, 3, 3)

library(fda)
fig1.2basis <- create.bspline.basis(c(0, 10),
                                    breaks=c(0, 2, 4, 7, 8, 10))
# fda:::fd is used temporarily;  fd should work later
# but doesn't while debugging DierckxSpline and fda together
fig1.2a.fda <- fda:::fd(c(1, 2, 5, -5, 5, -1, 3, 3), fig1.2basis)
plot(fig1.2a.fda, ylim=c(-5, 5))

# NOTE:
# An attempt to create this Figure using 'curfit'
# failed, because 'curfit' dropped the knots at 2 and 8.

cP <- controlPolygon(fig1.2a.fda)
lines(cP[, 1], cP[, 2], lty="dotted")

fig1.2a.dierckx <- fd2dierckx(fig1.2a.fda)
cPdierckx <- controlPolygon(fig1.2a.dierckx)
all.equal(cP, cPdierckx)
#  "Mean relative  difference: 5.745888e-07"

DierckxSpline documentation built on May 2, 2019, 6:30 p.m.