Learn R Programming

MultivariateTrendAnalysis (version 0.1.3)

mkComponent: Component Wise Mann-Kendall Test Statistic

Description

The functions performs the univariate Mann-Kendall test statistic to each variable of a data series.

Usage

mkComponent(data)

Value

A numeric vector with the univariate MK test statistic for each component of the data series.

Arguments

data

Numeric matrix representing the data series, each column should be a component.

Details

Let \(M\) be a dataset of \(m\) components and \(n\) observations. The Mann-Kendall's (MK) test statistic for a variable of the dataset \(M^{(u)}\) is given by:

$$M^{(u)} = \sum_{1 \leq i \leq j \leq n} sgn(x_j^{(u)} - x_i^{(u)})$$ where \(sgn(\cdot)\) is the sign function: $$ sgn(x)=\begin{cases} -1 \quad \text{if } x<0, \\ 0 \quad \text{if } x=0, \\ +1 \quad \text{if } x>0 \end{cases} $$

This test statistic is normal distributed, with mean and variance: $$E(M^{(u)}) = 0$$, $$\text{var}(M^{(u)}) = \frac{n(n-1)(2n+5)}{18}$$

References

  • Hamed, K.H., Rao, A.R., 1998. A modified Mann-Kendall trend test for autocorrelated data. J. Hydrol. 204 (1–4), 182–196.

  • Kendall, M., (1975). Rank Correlation Methods; Griffin: London.

Examples

Run this code
# Sample data (Both marginal distributions have trend):
dataMarginalTrend <- generate_data("marginalTrend", n = 50)

# Perform multivariate MK test on sample data:
mkComponent(dataMarginalTrend)

Run the code above in your browser using DataLab