knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

capacc

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".

Overview

Functionality:

Installation

You can install capacc from github with:

# install.packages("devtools")
devtools::install_github("Tveten/capacc")

Exported and documented functions

For more information, see the documentation of the functions below inside R.

The following functions rerun the simulation study:

Example

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)


Tveten/capacc documentation built on Sept. 29, 2021, 5:31 a.m.