rtsa.mk: Raster time series Mann-Kendall trend test

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/rtsa.mk.R

Description

This function conducts Mann-Kendall trend test from raster time series using "Kendall" package especially designed to handle gappy time series.

Usage

1
2
rtsa.mk(rasterts, rastermask = NULL, gapfill = "none", cores = 1L,
  verbose = FALSE)

Arguments

rasterts

Input raster time series as RasterStackTS or RasterBrickTS object.

rastermask

Either a RasterLayer or "compute". Raster layer to use as a mask. When "compute" is set raster mask is computed to remove all pixels with incomplete time series.

gapfill

Character. Defines the algorithm to be used to interpolate pixels with incomplete temporal profiles. Accepts argument supported as method in function rtsa.gapfill.

cores

Integer. Defines the number of CPU to be used for multicore processing. Default to "1" core for singlecore processing.

...

Additional arguments to be passed through to function MannKendall.

Value

Object of class MKstack-class containing the following components:

tau Kendall tau statistic
pvalue Kendall two-sided p-value
score Kendall Score
variance Variance of Kendall Score

Author(s)

Federico Filipponi

References

Mann, H.B. (1945). Non-parametric tests against trend. Econometrica, 13, 163-171. Kendall, M.G. (1975). Rank Correlation Methods, 4th edition. Charles Griffin, London. Gilbert, R.O. (1987) . Statistical Methods for Environmental Pollution Monitoring. Wiley, NY. Davison, A.C. and Hinkley, D.V. (1997) Bootstrap Methods and Their Application. Cambridge University Press. Hipel, K.W. and McLeod, A.I., (2005). Time Series Modelling of Water Resources and Environmental Systems. Electronic reprint of our book orginally published in 1994. book

See Also

MannKendall, rtsa.stl, rtsa.seas, rtsa.gapfill

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
## create raster time series using the 'pacificSST' data from 'remote' package
require(remote)

data(pacificSST)
pacificSST[which(getValues(pacificSST == 0))] <- NA # set NA values
# create rts object
rasterts <- rts(pacificSST, seq(as.Date('1982-01-15'), as.Date('2010-12-15'), 'months'))

## generate raster mask
raster_mask <- pacificSST[[1]] # create raster mask
names(raster_mask) <- "mask"
values(raster_mask) <- 1 # set raster mask values
raster_mask[which(is.na(getValues(pacificSST[[1]])))] <- 0 # set raster mask values

# compute Mann-Kendall trend test
MannKendall_result <- rtsa.mk(rasterts=rasterts, rastermask=raster_mask)
# compute Mann-Kendall trend test using multiple cores on monthly time series
### create monthly averages
rasterts_monthly_mean <- apply.monthly(rasterts, mean)
MannKendall_monhtly_result <- rtsa.mk(rasterts=rasterts_monthly_mean, rastermask=raster_mask)

## End(Not run)

ffilipponi/rtsa documentation built on Oct. 18, 2019, 12:37 a.m.