wmw_test: Wilocxon-Mann-Whitney Test for Change Points

View source: R/wmw_test.R

wmw_testR Documentation

Wilocxon-Mann-Whitney Test for Change Points

Description

Performs the Wilcoxon-Mann-Whitney change point test.

Usage

wmw_test(x, h = 1L, method = "kernel", control = list(), tol = 1e-8, 
         plot = FALSE)

Arguments

x

time series (numeric or ts vector).

h

version of the test (integer, 1L or 2L)

method

method for estimating the long run variance.

control

a list of control parameters (cf. lrv).

tol

tolerance of the distribution function (numeric), which is used to compute p-values.

plot

should the test statistic be plotted (cf. plot.cpStat). Boolean.

Details

The function performs a Wilcoxon-Mann-Whitney change point test. It tests the hypothesis pair

H_0: μ_1 = ... = μ_n

vs.

H_1: \exists k \in \{1, ..., n-1\}: μ_k \neq μ_{k+1}

where μ_t = E(X_t) and n is the length of the time series. k is called a 'change point'.

The test statistic is computed using wilcox_stat and asymptotically follows a Kolmogorov distribution. To derive the p-value, the function pKSdist is used.

Value

A list of the class "htest" containing the following components:

statistic

value of the test statistic (numeric).

p.value

p-value (numeric).

alternative

alternative hypothesis (character string).

method

name of the performed test (character string).

cp.location

index of the estimated change point location (integer).

data.name

name of the data (character string).

Author(s)

Sheila Görz

References

Dehling, H., et al. "Change-point detection under dependence based on two-sample U-statistics." Asymptotic laws and methods in stochastics. Springer, New York, NY, 2015. 195-220.

See Also

wilcox_stat, lrv, pKSdist

Examples

#time series with a structural break at t = 20
Z <- c(rnorm(20, 0), rnorm(20, 2))

wmw_test(Z, h = 1L, control = list(overlapping = TRUE, b_n = 5))

robcp documentation built on Sept. 16, 2022, 5:05 p.m.

Related to wmw_test in robcp...