MannKendallSeg: Apply MannKendall test for segments of a time series

Description Usage Arguments Value Author(s) See Also Examples

Description

The function call MannKendall for different segments of a time series

Usage

1
2
MannKendallSeg(Yt, seg = NULL, 
    bp = NoBP())

Arguments

Yt

univariate time series of class ts

seg

a vector indicating segments of a time series. If NULL, provide bp

bp

detected breakpoints in the time series as returned by breakpoints

Value

The function returns a data.frame with the estimated Mann-Kendall tau and p-value for each segment of the time series.

Author(s)

Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]

See Also

MannKendall

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# aggregate time series to annual time steps
ndvi <- aggregate(ndvi, FUN=mean)
plot(ndvi)

# MannKendall test for different segments
seg <- c(rep(1, length(start(ndvi)[1]:1995)), rep(2, length(1996:end(ndvi)[1])))
mk <- MannKendallSeg(ndvi, seg)
mk

# MannKendall test for segments that are defined by breakpoints
bp <- breakpoints(ndvi ~ time(ndvi))
mk <- MannKendallSeg(ndvi, bp=bp)
mk

# MannKendall test without segments
MannKendallSeg(ndvi)

greenbrown documentation built on Dec. 18, 2020, 3:02 p.m.