Anomaly Detection In Time Series

Basic scenarios and methods

Arun Jagota
6 min readOct 6, 2023

A time series is a sequence of numbers over time. Such as daily closing prices of a certain stock, or daily high temperatures in a particular location.

Anomalies in time series are values that are highly inconsistent with those expected around at those time points.

Anomaly detection has numerous use cases. Below is a small (and biased) sample.

  • Identifying temperatures in a time series of historical data of daily high temperatures in a particular location that were anomalous (too high or too low for that day).
  • Detecting a significant increase in the latency of a software service compared to what is expected.

The former may be called retroactive anomaly detection, the latter real-time anomaly detection.

In this post, we cover various basic scenarios of anomaly detection in time series to better understand the problem. Alongside them we cover basic scenario-specific ideas to attempt to detect anomalies in them.

Once we are finished with these scenarios we take a second pass at how to detect anomalies, this time with the intent to use a single method that can work across all these scenarios, at least in principle.

Finally, we cover additional scenarios that are also common in certain use cases, albeit less universal.

--

--

Arun Jagota

PhD, Computer Science, neural nets. 14+ years in industry: data science algos developer. 24+ patents issued. 50 academic pubs. Blogs on ML/data science topics.