decdiff {pastecs} | R Documentation |
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 type="additive" (by default), or type="multiplicative" |
lag |
The lag between the two observations used to calculate differences. By default, lag=1 |
order |
The order of the difference corresponds to the number of times it is applied, by default order=1 |
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 ends="drop" , the filtered series will be shorter than the initial one by lag*order. In all other cases, the filtered series is as large as the initial one |
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.
tsd
, tseries
, decaverage
, deccensus
, decmedian
, decevf
, decreg
, decloess
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")