knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
An R
package for detecting (collective and point) anomalies (CAPA-CC) or changepoints (CPT-CC) in cross-correlated data.
It also contains code to reproduce the simulation study in Tveten, Eckley, Fearnhead (2020) "Scalable changepoint and anaomly detection in cross-correlated data with an application to condition monitoring".
Functionality:
You can install capacc from github with:
# install.packages("devtools") devtools::install_github("Tveten/capacc")
For more information, see the documentation of the functions below inside R.
The following functions rerun the simulation study:
library(capacc) p <- 10 Sigma <- solve(car_precision_mat(lattice_neighbours(p), rho = 0.95)) x <- simulate_cor(n = 200, p = p, Sigma = Sigma)$x Q <- robust_sparse_precision(x, adjacency_mat(banded_neighbours(2, ncol(x)), sparse = FALSE)) print(round(Q, 2)) res <- capa.cc(x, Q, b = 1, min_seg_len = 5) plot(res) collective_anomalies(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.