set_outlier_threshold {oddstream} | R Documentation |
Set a threshold for outlier detection
Description
This function forecasts a boundary for the typical behaviour using a representative sample of the typical behaviour of a given system. An approach based on extreme value theory is used for this boundary prediction process.
Usage
set_outlier_threshold(pc_pcnorm, p_rate = 0.001, trials = 500)
Arguments
pc_pcnorm |
The scores of the first two pricipal components returned by |
p_rate |
False positive rate. Default value is set to 0.001 |
trials |
Number of trials to generate the extreme value distirbution. Default value is set to 500. |
Value
Returns a threshold to determine outlying series in the next window consists with a collection of time series.
References
Clifton, D. A., Hugueny, S., & Tarassenko, L. (2011). Novelty detection with multivariate extreme value statistics. Journal of signal processing systems, 65 (3),371-389.
Talagala, P., Hyndman, R., Smith-Miles, K., Kandanaarachchi, S., & Munoz, M. (2018). Anomaly detection in streaming nonstationary temporal data (No. 4/18). Monash University, Department of Econometrics and Business Statistics.
See Also
find_odd_streams
, extract_tsfeatures
, get_pc_space
,
gg_featurespace
Examples
# Generate training dataset
set.seed(123)
nobs <- 500
nts <- 50
train_data <- ts(apply(matrix(ncol = nts, nrow = nobs), 2, function(nobs){10 + rnorm(nobs, 0, 3)}))
features <- extract_tsfeatures(train_data)
pc <- get_pc_space(features)
threshold <- set_outlier_threshold(pc$pcnorm)
threshold$threshold_fnx