splineZeros          package:DierckxSpline          R Documentation

_F_i_n_d _t_h_e _z_e_r_o_s _o_f _a _s_p_l_i_n_e

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     splineZeros(object, maxiter)

_A_r_g_u_m_e_n_t_s:

  object: An object of class 'dierckx'.

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

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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]

_A_u_t_h_o_r(_s):

     Spencer Graves

_R_e_f_e_r_e_n_c_e_s:

     Dierckx, P. (1993) _Curve and Surface Fitting with Splines_,
     Oxford Science Publications.

_S_e_e _A_l_s_o:

     'curfit','insert.dierckx','predict.dierckx','uniroot'

_E_x_a_m_p_l_e_s:

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

