controlPolygon         package:DierckxSpline         R Documentation

_C_o_n_t_r_o_l _p_o_l_y_g_o_n _o_f _a _s_p_l_i_n_e

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

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

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

     controlPolygon(object)

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

  object: an object of class 'dierckx' or 'fd' 

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

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

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

     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.

_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', 'fd'

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

     # 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))
     fig1.2a.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"

