Description Usage Arguments Details Value Author(s) References See Also Examples
The control polygon matches running means of k knots with the spline coefficients, where k = the degree of the knots. See Dierckx(p. 20).
1 | controlPolygon(object)
|
object |
an object of class 'dierckx' or 'fd' |
Dierckx(p. 20-22, including Figure 1.2) explains how the control polygon can help isolate the zeros of a spline.
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.
Spencer Graves
Dierckx, P. (1993) Curve and Surface Fitting with Splines, Oxford Science Publications.
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"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.