Learn R Programming

MultivariateTrendAnalysis (version 0.1.3)

MOT_test: Multivariate Overall Trend Test

Description

Computes the test statistic for the multivariate overall trend (MOT) test and the p-value.

Usage

MOT_test(data, covar = NULL, width, alpha = 0.05, Nbs = 1000)

Value

A named list:

  • statistic, computed MOT 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 of the series.

covar

Numeric vector, time order of the data series. If none given \(covar = 1, 2, ..., n\).

width

Integer, 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 overall trend (MOT) test allows to check for trend in the marginals and dependence structure of a multivariate distribution. 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 evaluates a null hypothesis of no trend in the data series, against an alternative hypothesis of a monotonic trend. 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 variables in a data series, and \(T\) the time order, the test statistic is given by:

$$T_{MOT}=\frac{1}{3}\left(\tau_n(X,T)^2 + \tau_n(Y,T)^2 + \tau_n(\tau_{nw}(X,Y),T')^2 \right)$$

where \(\tau_n\) is the empirical version of bivariate Kendall's \(\tau\). The series of the Kendall's \(\tau\) obtained through moving window is \(\tau_{nw}(X, Y)\), and \(T'\) is the time order of the moving 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", n = 50)

width <- 10

# Perform the mot test:
mot <- MOT_test(DependenceStructure, covar = NULL, width, alpha = 0.05, Nbs = 1000)
print(mot)


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

# Perform the mot test:
mot <- MOT_test(MarginalTrend, width = width)
print(mot)


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

# Perform the mot test:
mot <- MOT_test(NoTrend, width = width)
print(mot)
# }


Run the code above in your browser using DataLab