significantTau | R Documentation |
\tau
Apply the Mann-Kendall trend test (Mann, 1945) to a series of observations
and return Kendall's \tau
(Kendall, 1938) based on a predefined
significance level. In contrast to other readily available implementations,
it is up to the user to decide whether or not to apply pre-whitening as
described in the zyp package vignette (Bronaugh and Werner, 2013).
## S4 method for signature 'numeric'
significantTau(
x,
p = 0.001,
prewhitening = TRUE,
method = c("yuepilon", "zhang"),
df = FALSE
)
## S4 method for signature 'RasterStackBrick'
significantTau(
x,
p = 0.001,
prewhitening = TRUE,
method = c("yuepilon", "zhang"),
filename = "",
...
)
x |
Either a |
p |
|
prewhitening |
|
method |
|
df |
|
filename |
|
... |
Further arguments passed to |
If available, the function will automatically use open multi-core clusters
for parallel processing (see beginCluster
and Examples).
numeric
input: If df = FALSE
(default), a single
numeric
or logical
(i.e., NA
) depending on whether or
not 'p' was exceeded; else a data.frame
with Kendall's \tau
and
the corresponding significance level.
RasterStackBrick
input: A RasterLayer
with values of
Kendall's \tau
. Values exceeding the specified 'p' are discarded.
Kendall, M.G. (1938). A new measure of rank correlation. Biometrika 30(1/2), 81-93, doi: 10.2307/2332226.
Mann, H.B. (1945). Nonparametric tests against trend. Econometrica 13(3), 245-259, doi: 10.2307/1907187.
Zhang, X., Vincent, L.A., Hogg, W.D. and A. Niitsoo (2000). Temperature and Precipitation Trends in Canada during the 20th Century. Atmosphere-Ocean 38(3), 395-429, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07055900.2000.9649654")}.
Yue, S., Pilon, P., Phinney, B. and G. Cavadias (2002). The influence of autocorrelation on the ability to detect trend in hydrological series. Hydrological Processes 16, 1807-1829,\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/hyp.1095")}.
MannKendall
, zyp.trend.vector
.
## Example taken from ?Kendall::MannKendall
library(Kendall)
data(PrecipGL)
plot(PrecipGL)
## Mann-Kendall trend test without pre-whitening
x <- as.numeric(PrecipGL)
significantTau(x, p = 0.001, prewhitening = FALSE, df = TRUE)
## Mann-Kendall trend test with pre-whitening
significantTau(x, p = 0.001, prewhitening = TRUE, df = TRUE)
#############################################################################
### use case: significant mann-kendall trends in ndvi3g.v0 #########
#############################################################################
## Not run:
## Sample data from 1982 to 2013
data("kili3g.v0")
rst <- kili3g.v0[[13:nlayers(kili3g.v0)]]
## Remove seasonal signal
library(remote)
dsn <- deseason(rst, cycle.window = 24)
## Apply trend-free pre-whitened Mann-Kendall test (note that
## non-significant pixels are set to NA)
trd1 <- significantTau(dsn, p = 0.01, prewhitening = TRUE)
plot(trd1)
## Or, alternatively, use multi-core functionality
cores <- parallel::detectCores() - 1
if (require(snow)) {
beginCluster(cores)
trd2 <- significantTau(dsn, p = 0.01, prewhitening = TRUE)
endCluster()
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.