splineZeros {DierckxSpline}R Documentation

Find the zeros of a spline

Description

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

Usage

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]

normal-bracket21bracket-normal

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

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])


[Package DierckxSpline version 1.0-9 Index]