capa.uv {anomaly} | R Documentation |

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.

capa.uv( x, beta = NULL, beta_tilde = NULL, type = "meanvar", min_seg_len = 10, max_seg_len = Inf, transform = robustscale )

`x` |
A numeric vector containing the data which is to be inspected. |

`beta` |
A numeric vector of length 1 or |

`beta_tilde` |
A numeric constant indicating the penalty for adding an additional point anomaly. It defaults to 3log(n), where n denotes the number of observations. |

`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), "mean" for collective anomalies characterised by changes in mean only, or "robustmean" for collective anomalies characterised by changes in mean only which can be polluted by outliers. |

`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 instance of an S4 class of type capa.uv.class.

Fisch ATM, Eckley IA, Fearnhead P (2018).
“A linear time method for the detection of point and collective anomalies.”
*ArXiv e-prints*.
https://arxiv.org/abs/1806.01947.

library(anomaly) data(machinetemp) attach(machinetemp) res<-capa.uv(temperature,type="mean") canoms<-collective_anomalies(res) dim(canoms)[1] # over fitted due to autocorrelation psi<-0.98 # computed using covRob inflated_penalty<-3*(1+psi)/(1-psi)*log(length(temperature)) res<-capa.uv(temperature,type="mean",beta=inflated_penalty, beta_tilde=inflated_penalty) summary(res) plot(res) library(anomaly) data(Lightcurves) ### Plot the data for Kepler 10965588: No transit apparent plot(Lightcurves$Kepler10965588$Day,Lightcurves$Kepler10965588$Brightness,xlab = "Day",pch=".") ### Examine a period of 62.9 days for Kepler 10965588 binned_data = period_average(Lightcurves$Kepler10965588,62.9) inferred_anomalies = capa.uv(binned_data) plot(inferred_anomalies)

[Package *anomaly* version 4.0.1 Index]