Regulation of a time series using splines
Transform an irregular time series in a regular time series, or fill gaps in regular time series using splines
regspline(x, y=NULL, xmin=min(x), n=length(x), deltat=(max(x) - min(x))/(n - 1), rule=1, periodic=FALSE)
x |
a vector with time in the irregular series. Missing values are allowed |
y |
a vector of same length as |
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 |
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., |
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 |
periodic |
indicates if the time series should be considered as periodic ( |
Missing values are interpolated using cubic splines between observed values.
An object of type 'regul' is returned. It has methods print()
, summary()
, plot()
, lines()
, identify()
, hist()
, extract()
and specs()
.
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.
Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)
Lancaster, P. & K. Salkauskas, 1986. Curve and surface fitting. Academic Press, England, 280 pp.
data(releve) reg <- regspline(releve$Day, releve$Melosul) plot(releve$Day, releve$Melosul, type="l") lines(reg$x, reg$y, col=2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.