Description Usage Arguments Value Examples
View source: R/method_capacc.R
A method for detecting anomalous segments and points based on CAPA-CC by Tveten, Eckley, Fearnhead (2020).
1 2 3 4 5 6 7 8 9 | capa.cc(
x,
Q,
b = 1,
b_point = 1,
min_seg_len = 2,
max_seg_len = 10^8,
transform = centralise
)
|
x |
An n x p data matrix where each row is an observation vector. |
Q |
An estimate of the precision matrix. See |
b |
The scaling factor for the collective anomaly penalty. Defaults to 1. |
b_point |
The scaling factor for the point anomaly penalty. Defaults to 1. |
min_seg_len |
The minimum segment length. Defaults to 2. |
max_seg_len |
The maximum segment length. Defaults to 10^8. |
transform |
A function used to centre the data prior to analysis by |
An S3 class of type capacc with the following components:
x
The input data matrix.
anoms
A data frame with four columns: start (start-point of the anomaly), end (end-point of an anomaly), variate (which variable is affected) and size (the estimated size of the mean component for the given variate).
1 2 3 4 5 6 | library(capacc)
x <- simulate_cor()$x
Q <- robust_sparse_precision(x, adjacency_mat(banded_neighbours(2, ncol(x)), sparse = FALSE))
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.