TrendSample {greenbrown} | R Documentation |
The function computes an ensemble of trend statistics (linear trend slope, Mann-Kendall tau and p-value) on a time series by sampling different start and end dates of the time series. This ensemble can be used to compute uncertainties in trend statistics. Results can be plotted using the function plot.TrendSample
.
TrendSample(Yt, sample.method = c("all", "sample", "none"), sample.min.length = 0.7, sample.size = 30, trend = TrendAAT)
Yt |
univariate time series of class |
sample.method |
Sampling method for combinations of start and end dates to compute uncertainties in trends. If "sample" (default), trend statistics are computed for a sample of combinations of start and end dates according to |
sample.min.length |
Minimum length of the time series (as a fraction of total length) that should be used to compute trend statistics. Time windows between start and end that are shorter than min.length will be not used for trend computation. |
sample.size |
sample size (number of combinations of start and end dates) to be used if |
trend |
method that should be used to compute the trend |
The function returns a data.frame with the start date, end date and length of the sample from the time series and the correspondig Mann-Kendall tau, p-value, slope, intercept, and percentage slope of a linear trend.
Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]
# load a time series of NDVI (normalized difference vegetation index) data(ndvi) # calculate uncertainty of trend dependent on start and end dates trd.ens <- TrendSample(ndvi, trend=TrendAAT) plot(trd.ens) plot(trd.ens, "tau") trd.ens <- TrendSample(ndvi, trend=TrendRQ) plot(trd.ens) # plot relations between start, end dates, length and trend statistics