Description Usage Arguments Value Author(s) See Also Examples
This function computes several time-variant statisttics of a time series like seasonal anomalies, time lagged versions of time series, and filters
time series based on running windows (using rollapply
.
1 2 3 4 5 6 7 8 9 | AnomaliesFiltersLags(x,
funSeasonalCycle = MeanSeasonalCycle,
funFilter = median,
alignFilter = c("center",
"left", "right"),
filters = c(3, 5,
7, 9, 11, 13),
lags = -1:-7, anom = TRUE,
...)
|
x |
univariate time series of class |
funSeasonalCycle |
a function to estimate the seasonal cycle of the time series. |
funFilter |
a function to filter the time series based on rolling windows. |
alignFilter |
specifies whether the index of the running filter results should be left- or right-aligned or centered (default) compared to the rolling window of observations. See |
filters |
window sizes for rolling |
lags |
time |
anom |
compute seasonal anomalies? |
... |
further arguments (currently not used) |
The function returns a multivariate time series of class 'mts' with the following columns:
orig
the original time series
msc
mean seasonal cycle as computed with funSeasonalCycle
(repeated for the full time series length)
anom
anomalies releative to mean seasonal cycle
orig.filterX
rolling window result based on the original time series as computed with funFilter
for the filter window size X
anom.filterX
rolling window result based on the anomaly time series as computed with funFilter
for the filter window size X
orig.lagX
time lagged version of the original time series for the time lag X
msc.lagX
time lagged version of the mean seasonal cycle time series for the time lag X
anom.lagX
time lagged version of the anomaly time series for the time lag X
Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # do calculations
afl <- AnomaliesFiltersLags(ndvi)
summary(afl)
# seasonal anomalies
plot(afl[,"anom"])
# running median filters on original time series
plot(afl[, grep("orig.filter", colnames(afl))], plot.type="single", col=rainbow(6))
# running median filters on anomalies
plot(afl[, grep("anom.filter", colnames(afl))], plot.type="single", col=rainbow(6))
# lagged versions of original time series
plot(window(afl[, grep("orig.lag", colnames(afl))], start=c(1995, 1),
end=c(2000, 12)), plot.type="single", col=rainbow(7), type="l")
# lagged versions of anomaly time series
plot(afl[, grep("anom.lag", colnames(afl))], plot.type="single", col=rainbow(7))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.