Marcnuth / AnomalyDetection

Twitter's Anomaly Detection in Pure Python
Apache License 2.0
304 stars 76 forks source link

This ESD test implementation differs from the Twitter's R implementation and the definition of the test #23

Open pkwan9 opened 5 years ago

pkwan9 commented 5 years ago

By definition of the test and Twitter's R implementation, all the candidates that have been considered until the largest i such that max_R_i > lambda_i are all anomalies, not just the ones that are in the iterations that have max_R_i > lambda_i.

There have been simulation studies showing that the inequality of max_R_i > lambda_i can swing back and froth as the iteration is progressed. This python implementation of ESD test may miss some anomalies.

mikeyling18 commented 4 years ago

I, too, have experienced discrepancies between the output of R and Python. There seems to be only a few lines that I changed in order for R and Python to output the same things (at least, on the time series I'm feeding into the two implementations...). I'll be submitting a pull request soon with these minor changes!