splineZeros: Find the zeros of a spline

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

Description

Find the zeros of a spline starting with the control polygon.

Usage

1
splineZeros(object, maxiter)

Arguments

object

An object of class dierckx.

maxiter

maximum number of iterations allowed so the signs of the control polygon match those of the spline.

Details

As described in Dierckx(1993, pp. 16-22):

1. cP <- controlPolygon(object)

2. Evaluate the spline at the zeros of the control polygon.

3. While there are sign changes in the control polygon that are not matched by sign changes in the spline, insert knots, recompute the control polygon and the spline at the zeros of the control polygon. Iterate.

4. Use 'uniroot' to obtain the zero in each interval containing a sign change in the spline.

Value

a matrix with one column for each of the outputs of 'uniroot':

root

estimated zero

f.root

value of the spline at 'root'

iter

number of iterations required by 'uniroot'

estim.prec

estimated precision for [root]

Author(s)

Spencer Graves

References

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

See Also

curfit,insert.dierckx,predict.dierckx,uniroot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
xi <- 1:10
yi <- sin(xi)
spli <- curfit(xi, yi, s=10)

cPi <- controlPolygon(spli)
x. <- seq(1, 10, length=201)
plot(x., predict(spli, x.), type="l")
points(xi, yi)

abline(h=0)
lines(cPi[, 1], cPi[, 2], lty=2)
Zeros <- splineZeros(spli)
abline(v=Zeros[, 1])

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