Trend {greenbrown}R Documentation

Calculate trends and trend changes in time series

Description

This function calculates trends and trend changes (breakpoints) in a time series. It is a common interface to the functions TrendAAT, TrendSTM and TrendSeasonalAdjusted. With TrendRaster all trend analysis functions can be applied to gridded (raster) data. A detailed description of these methods can be found in Forkel et al. (2013).

Usage

Trend(Yt, method = c("AAT", "STM", "SeasonalAdjusted", "RQ"), 
    mosum.pval = 0.05, h = 0.15, breaks = NULL, funSeasonalCycle = MeanSeasonalCycle, 
    funAnnual = mean)

Arguments

Yt

univariate time series of class ts

method

method to be used for trend calculation with the following options:

  • AAT (default) calculates trends on annual aggregated time series (see TrendAAT for details). This method will be automatically choosen if the time series has a frequency of 1 (e.g. in case of annual time steps). If the time series has a frequency > 1, the time series will be aggregated to annual time steps using the mean.

  • STM fits harmonics to the seasonal time series to model the seasonal cycle and to calculate trends based on a multiple linear regression (see TrendSTM for details).

  • SeasonalAdjusted removes first the seasonal cycle from the time series and calculates the trend on the reaminder series (see TrendSeasonalAdjusted for details).

  • RQ computes trends based on quantile regression (see TrendRQ for details).

mosum.pval

Maximum p-value for the OLS-MOSUM test in order to search for breakpoints. If p = 0.05, breakpoints will be only searched in the time series trend component if the OLS-MOSUM test indicates a significant structural change in the time series. If p = 1 breakpoints will be always searched regardless if there is a significant structural change in the time series or not. See sctest for details.

h

minimal segment size either given as fraction relative to the sample size or as an integer giving the minimal number of observations in each segment. See breakpoints for details.

breaks

maximal number of breaks to be calculated (integer number). By default the maximal number allowed by h is used. See breakpoints for details.

funSeasonalCycle

a function to estimate the seasonal cycle of the time series if SeasonalAdjusted is selected as method. A own function can be defined to estimate the seasonal cycle which has to return the seasonal cycle as a time series of class ts. Currently two approaches are part of this package:

funAnnual

function to aggregate time series to annual values if AAT is selected as method. The default function is the mean (i.e. trend calculated on mean annual time series). See TrendAAT for other examples

Details

This function allows to calculate trends and trend changes based on different methods: see TrendAAT, TrendSTM or TrendSeasonalAdjusted for more details on these methods. These methods can be applied to gridded (raster) data using the function TrendRaster.

Value

The function returns a list of class "Trend".

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

References

Forkel, M., N. Carvalhais, J. Verbesselt, M. Mahecha, C. Neigh and M. Reichstein (2013): Trend Change Detection in NDVI Time Series: Effects of Inter-Annual Variability and Methodology. - Remote Sensing 5.

See Also

plot.Trend, TrendAAT, TrendSTM, TrendSeasonalAdjusted, TrendRaster, breakpoints

Examples

# load a time series of NDVI (normalized difference vegetation index)
data(ndvi)
plot(ndvi)
	
# calculate trend (default method: trend calculated based on annual aggregated data)
trd <- Trend(ndvi)
trd
plot(trd)

# an important parameter is mosum.pval: if the p-value is changed to 1, 
# breakpoints can be detected in the time series regardless if 
# there is significant structural change
trd <- Trend(ndvi, mosum.pval=1)
trd
plot(trd)

# calculate trend based on modelling the seasonal cycle
trd <- Trend(ndvi, method="STM")
trd
plot(trd)

# calculate trend based on removal of the seasonal cycle
trd <- Trend(ndvi, method="SeasonalAdjusted", funSeasonalCycle=MeanSeasonalCycle)
plot(trd)
lines(trd$adjusted, col="green")
trd

# modify maximal number of breakpoints
trd <- Trend(ndvi, method="SeasonalAdjusted", breaks=1)
plot(trd)
trd

# use quantile regression
trd <- Trend(ndvi, method="RQ")
plot(trd)
trd



[Package greenbrown version 2.4.3 Index]