Various anomaly detection algorithms studied in anomaly detection project including K-L divergence: Cho et al. (2019)
devtools::install_github("ygeunkim/swatanomaly")
library(swatanomaly)
This algorithm implements neighboring-window method. Using
stats::density()
, we first estimate each probability mass. Then we can
compute K-L divergence from to
by
The algorithm uses a threshold
and check if
. If this holds, two windows can be said that they are
derived from the same gaussian distribution.
Note that the number of window is
- Data: univariate series of size
- Input: window size
, jump size for sliding window
, threshold increment
, threshold updating constant
The threshold is initialized by
Cho, Jinwoo, Shahroz Tariq, Sangyup Lee, Young Geun Kim, and Simon Woo. 2019. “Contextual Anomaly Detection by Correlated Probability Distributions using Kullback-Leibler Divergence.” WORKSHOP ON MINING AND LEARNING FROM TIME SERIES.