home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / spline < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.7 KB  |  56 lines

  1.     
  2.     _S_p_l_i_n_e _I_n_t_e_r_p_o_l_a_t_i_o_n
  3.     
  4.          spline(x, y, n=3*length(x), xmin=min(x), xmax=max(x),
  5.                  method="fmm")
  6.     
  7.     _A_r_g_u_m_e_n_t_s:
  8.     
  9.              x,y : vectors giving the coordinates of the points
  10.                    to be interpolated.  Alternatively a single
  11.                    plotting structure can be specified.
  12.     
  13.                n : interpolation takes place at n equally spaced
  14.                    points spanning the interval [xmin, xmax].
  15.     
  16.             xmin : left-hand endpoint of the interpolation
  17.                    interval.
  18.     
  19.             xmax : right-hand endpoint of the interpolation
  20.                    interval.
  21.     
  22.           method : this specifies the type of spline to be used.
  23.                    Possible values are "fmm", "natural" and
  24.                    "periodic".
  25.     
  26.     _D_e_s_c_r_i_p_t_i_o_n:
  27.     
  28.          spline performs cubic spline interpolation of the given
  29.          data points.  It returns a list containing components
  30.          x, and y which give the ordinates where interpolation
  31.          took place and the interpolated values.
  32.     
  33.          If method="fmm", the spline used is that of Forsythe,
  34.          Malcolm and Moler (an exact cubic is fitted through the
  35.          four points at each end of the data, and this is used
  36.          to determine the end conditions).  Natural splines are
  37.          used when method="natural" and periodic splines when
  38.          method="periodic".
  39.     
  40.     _R_e_f_e_r_e_n_c_e_s:
  41.     
  42.          Forsythe, G. E., M. A. Malcolm and C. B. Moler (1977).
  43.          Computer Methods for Mathematical Computations.
  44.     
  45.     _S_e_e _A_l_s_o:
  46.     
  47.          approx, approxfun, splinefun.
  48.     
  49.     _E_x_a_m_p_l_e_s:
  50.     
  51.          x <- 1:10
  52.          y <- rnorm(10)
  53.          plot(x, y)
  54.          lines(spline(x, y))
  55.     
  56.