Learn R Programming

MultivariateTrendAnalysis (version 0.1.3)

MDT_test: Multivariate Dependence Trend Test

Description

Computes the test statistic for the multivariate dependence trend (MDT) test and the p-value.

Usage

MDT_test(data, width, alpha = 0.05, Nbs = 1000)

Value

Named list containing:

  • statistic, the MDT test statistic.

  • p.value, computed p-value computed using bootstrap.

  • result, the result of the test. If TRUE the trend is considered significant.

Arguments

data

Numeric matrix, a two dimensional data set where each column is a variable.

width

Numeric value, the width to be used for the moving window algorithm. Should be bigger than 1 and smaller than the number of observations, see details.

alpha

Numeric value, significance level for the test. Must be between 0 and 1, default is 0.05

Nbs

Positive Integer, number of samples to be used for bootstrapping. Default is 1000.

Details

The multivariate dependence trend (MDT) test allows to check for trend in the data series dependence structure. The moving window technique has been employed in order to take into account the dependence evolution, represented by Kendall's \(\tau\), according to time.

The test proposes a null hypothesis of no trend, against an alternative hypothesis of a monotonic trend in the dependence structure. Goutali and Chebana (2024) propose the following test statistic:

Let \(X = (x_1, x_2, ..., x_n)\) and \(Y = (y_1, y_2, ..., y_n)\) be two variables of a data series, the test statistic of the MDT test is given by:

$$T_{MDT}=\tau_n(\tau_{nw}(X,Y),T')$$

where \(\tau_n\) is the empirical version of bivariate Kendall's \(\tau\). The series of the Kendall's \(\tau\) obtained through moving window with width \(w\) is \(\tau_{nw}(X, Y)\), this series has length \(q = n - w +1\). \(T' = (1, 2, ..., q)\) is the time order of the rolling window series.

The choice of width is a trade-off. A small \(w\) increases the number of rolling windows for reliable analysis, while a large \(w\) is necessary to have sufficient values to identify the dependence structure. The p-value is computed using a bootstrap procedure.

References

Goutali, D., and Chebana, F. (2024). Multivariate overall and dependence trend tests, applied to hydrology, Environmental Modelling & Software, 179, tools:::Rd_expr_doi("10.1016/j.envsoft.2024.106090")

See Also

  • kendall.tau : Function from the package VGAM used for computing the bivariate Kendall's \(\tau\).

  • rollapply : Function from the package zoo used to apply the moving window technique.

  • samp.bootstrap: Function from the resample package, used to generate the samples necessary to perform bootstrapping.

Examples

Run this code

# \donttest{
# CASE 1: Only trend in the dependence structure
# Sample data:
DependenceStructure <- generate_data("dependenceStructure")

width <- 10

# Perform the mdt test:
mdt <- MDT_test(DependenceStructure, width, alpha = 0.05, Nbs = 1000)
print(mdt)


# CASE 2: Only trend in the marginal distributions
# Sample data:
MarginalTrend <- generate_data("marginalTrend")

# Perform the mdt test:
mdt <- MDT_test(MarginalTrend, width)
print(mdt)


# CASE 3: No trend
# Sample data:
NoTrend <- generate_data("noTrend")

# Perform the mdt test:
mdt <- MDT_test(NoTrend, width)
print(mdt)
# }


Run the code above in your browser using DataLab