Time series decomposition using differences (trend elimination)
A filtering using X(t+lag) - X(t) has the property to eliminate the general trend from the series, whatever its shape
decdiff(x, type="additive", lag=1, order=1, ends="fill")
x |
a regular time series ('rts' under S+ and 'ts' under R) |
type |
the type of model, either |
lag |
The lag between the two observations used to calculate differences. By default, |
order |
The order of the difference corresponds to the number of times it is applied, by default |
ends |
either "NAs" (fill first values that are not calculable with NAs), or "fill" (fill them with the average of following observations before applying the filter, by default), or "drop" (do not fill them). If |
This function is a wrapper around the diff()
function to create a 'tsd' object. It also manages initial values through the ends
argument.
a 'tsd' object
Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)
Kendall, M., 1976. Time-series. Charles Griffin & Co Ltd. 197 pp.
Laloire, J.C., 1972. Méthodes du traitement des chroniques. Dunod, Paris, 194 pp.
Philips, L. & R. Blomme, 1973. Analyse chronologique. Université Catholique de Louvain. Vander ed. 339 pp.
data(marbio) ClausoB.ts <- ts(log(marbio$ClausocalanusB + 1)) ClausoB.dec <- decdiff(ClausoB.ts, lag=1, order=2, ends="fill") plot(ClausoB.dec, col=c(1, 4, 2), xlab="stations")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.