Description Usage Arguments Value References Examples
A technique for detecting anomalous segments and points in univariate time series data based on CAPA (Collective And Point Anomalies) by Fisch et al. (2018). CAPA assumes that the data has a certain mean and variance for most
time points and detects segments in which the mean and/or variance deviates from the typical mean and variance as collective anomalies. It also detects point
outliers and returns a measure of strength for the changes in mean and variance. If the number of anomalous windows scales linearly with the number of
data points, CAPA scales linearly with the number of data points. At
worst, if there are no anomalies at all and max_seg_len
is unspecified, the computational cost of CAPA scales quadratically with the number of data points.
1 2 |
x |
A numeric vector containing the data which is to be inspected. |
beta |
A numeric constant indicating the penalty for adding an additional epidemic changepoint. It defaults to a BIC style penalty if no argument is provided. |
beta_tilde |
A numeric constant indicating the penalty for adding an additional point anomaly. It defaults to a BIC style penalty if no argument is provided. |
type |
A string indicating which type of deviations from the baseline are considered. Can be "meanvar" for collective anomalies characterised by joint changes in mean and variance (the default) or "mean" for collective anomalies characterised by changes in mean only. |
min_seg_len |
An integer indicating the minimum length of epidemic changes. It must be at least 2 and defaults to 10. |
max_seg_len |
An integer indicating the maximum length of epidemic changes. It must be at least the min_seg_len and defaults to Inf. |
transform |
A function used to transform the data prior to analysis by |
An S4 class of type capa.uv.class.
2018arXiv180601947Fanomaly
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(anomaly)
# Simulated data example
set.seed(2018)
# Generate data typically following a normal distribution with mean 0 and variance 1.
# Then introduce 3 anomaly windows and 4 point outliers.
x = rnorm(5000)
x[401:500] = rnorm(100,4,1)
x[1601:1800] = rnorm(200,0,0.01)
x[3201:3500] = rnorm(300,0,10)
x[c(1000,2000,3000,4000)] = rnorm(4,0,100)
res<-capa.uv(x)
res
plot(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.