permTest: KCP Permutation Test

View source: R/permTest.R

permTestR Documentation

KCP Permutation Test

Description

The KCP permutation test implements the variance test and the variance drop test to determine if there is at least one change point in the running statistics

Usage

permTest(
  data,
  RS_fun,
  wsize = 25,
  nperm = 1000,
  Kmax = 10,
  alpha = 0.05,
  varTest = FALSE
)

Arguments

data

data N x v dataframe where N is the number of time points and v the number of variables

RS_fun

Running statistics function: Should require the time series and wsize as input and return a dataframe of running statistics as output. This output dataframe should have rows that correspond to the time windows and columns that correspond to the variable(s) on which the running statistics were computed.

wsize

Window size

nperm

Number of permutations to be used in the permutation test

Kmax

Maximum number of change points desired

alpha

Significance level of the permutation test

varTest

If FALSE, only the variance DROP test is implemented, and if TRUE, both the variance and the variance DROP tests are implemented.

Value

sig

Significance of having at least one change point. 0 - Not significant, 1- Significant

p_var_test

P-value of the variance test.

p_varDrop_test

P-value of the variance drop test.

perm_rmin

A matrix of minimized variance criterion for the permuted data.

perm_rmin_without_NA

A matrix of minimized variance criterion for the permuted data without NA values.

References

Cabrieto, J., Tuerlinckx, F., Kuppens, P., Hunyadi, B., & Ceulemans, E. (2018). Testing for the presence of correlation changes in a multivariate time series: A permutation based approach. Scientific Reports, 8, 769, 1-20. doi:10.1038/s41598-017-19067-2


kcpRS documentation built on Oct. 25, 2023, 5:07 p.m.