Learn R Programming

KWCChangepoint (version 0.2.3)

mkwp: Find changepoints in multivariate data

Description

The mkwp() function detects changepoints in multivariate data using multivariate Kruskal-Wallis PELT (MKWP) algorithm developed by Ramsay and Chenouri (2023).

Usage

mkwp(data, depth = c("spat", "mahal", "mahal75", "hs"), k = 0.2)

Value

A list consisting of:

  • $changepoints : Indices of the changepoints detected; will return integer(0) if no changepoints are detected.

  • $method : A string "Multivariate Kruskal-Wallis PELT (MKWP)"

Arguments

data

Data in matrix or data.frame form, where each row is an observation and each column is a dimension.

depth

Depth function.

k

Penalty constant passed to pruned exact linear time algorithm.

References

Killick, R., P. Fearnhead, and I. A. Eckley. “Optimal Detection of Changepoints With a Linear Computational Cost.” Journal of the American Statistical Association 107, no. 500 (2012): 1590–98. https://doi.org/10.1080/01621459.2012.737745.

Ramsay, K., & Chenouri, S. (2023). Robust nonparametric multiple changepoint detection for multivariate variability. Econometrics and Statistics. https://doi.org/10.1016/j.ecosta.2023.09.001

Examples

Run this code
set.seed(111)
multi_data <-rbind(replicate(3,rnorm(200)),
                   replicate(3,rnorm(200,10)),
                   replicate(3,rnorm(200,0.2)))
mkwp(multi_data)

Run the code above in your browser using DataLab