MKendall: Mann-Kendall test for trend using block bootstrap

Description Usage Arguments Examples

Description

Return the results of the Mann-Kendall test for trends. In case of autocorrelation, the p-value of the test is obtained by block bootstrap. This function is a wrapper for the function MannKendall. If not specified by block, an automatic selection of the block sizes is provided according to the largest significant autocorrelation lag.

Usage

1
2
MKendall(x, block = NULL, block.max = 5, nboot = 1000, acf.ci = 0.95,
  acf.tol = 1, season = FALSE, ...)

Arguments

x

Sample.

block

Size of the bootstrap blocks. If block is NULL it is automatically selected

block.max

Maximal size for for block if selected automatically.

acf.tol

Value added to the largest significant autocorrelation to determine the block size.

...

Other parameters pass to tsboot.

nsim

Number of bootstrap sample.

acf.alpha

Determine the p-value of a significant autocorrelation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
set.seed(1)

## Case of independant data.
x <- rlnorm(100, 5, .1)
MKendall(x, block = 0)

## Case of autocorrelated data without trend.
x<- rep(0,100)
for(ii in seq_along(x)[-1])
  x[ii] <- 0.5 * x[ii-1] + rnorm(1,0,sd=15)

MKendall(x, block = 2)
MKendall(x)

## Case with autocorrelation with trend
MKendall(x+seq_along(x)/3)

 ## Case of trend in peaks magnitude
 pid <- which.floodPeaks(flow~date, canadaFlood$daily, u= 1000, r = 14)
 MKendall(canadaFlood$daily$flow[pid])

martindurocher/floodRFA documentation built on June 5, 2019, 8:44 p.m.