regspline              package:pastecs              R Documentation

_R_e_g_u_l_a_t_i_o_n _o_f _a _t_i_m_e _s_e_r_i_e_s _u_s_i_n_g _s_p_l_i_n_e_s

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

     Transform an irregular time series in a regular time series, or
     fill gaps in regular time series using splines

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

     regspline(x, y=NULL, xmin=min(x), n=length(x),
             deltat=(max(x) - min(x))/(n - 1), rule=1, periodic=FALSE)

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

       x: a vector with time in the irregular series. Missing values
          are allowed 

       y: a vector of same length as 'x' and holding observations at
          corresponding times 

    xmin: allows to respecify the origin of time in the calculated
          regular time series. By default, the origin is not redefined
          and it is equivalent to the smallest value in 'x' 

       n: the number of observations in the regular time series. By
          default, it is the same number than in the original irregular
          time series (i.e., 'length(x)' 

  deltat: the time interval between two observations in the regulated
          time series 

    rule: the rule to use for extrapolated values (outside of the range
          in the initial irregular time series) in the regular time
          series. With 'rule=1' (by default), these entries are not
          calculated and get 'NA'; with 'rule=2', these entries are
          extrapolated 

periodic: indicates if the time series should be considered as periodic
          ('periodic=TRUE', first value must be equal to the last one).
          If this is the case, first and second derivates used to
          calculate spline segments around first and last observations
          use data in the other extreme of the series. In the other
          case ('periodic=FALSE' (by default), derivates for extremes
          observations are considered to be equal to zero 

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

     Missing values are interpolated using cubic splines between
     observed values.

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

     An object of type 'regul' is returned. It has methods 'print()',
     'summary()', 'plot()', 'lines()', 'identify()', 'hist()',
     'extract()' and 'specs()'.

_N_o_t_e:

     This function uses 'spline()' for internal calculations. However,
     interpolated values are not allowed to be higher than the largest
     initial observation or lower than the smallest one.

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

     Frdric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean
     (phgrosjean@sciviews.org)

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

     Lancaster, P. & K. Salkauskas, 1986. _Curve and surface fitting._
     Academic Press, England, 280 pp.

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

     'regul', 'regarea', 'regconst', 'reglin', 'regul.screen',
     'regul.adj', 'tseries', 'is.tseries', 'splinefun'

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

     data(releve)
     reg <- regspline(releve$Day, releve$Melosul)
     plot(releve$Day, releve$Melosul, type="l")
     lines(reg$x, reg$y, col=2)

