Skip to content
AI.info

Unsupervised learning

Time-Series Anomalies and Change Points

Frame temporal anomaly detection through residuals, context, subsequences, change points, delays, and event-level evaluation.

By the end you can

Key idea

Point-wise metrics can reward unusable temporal detectors

A detector may emit hundreds of alerts throughout one incident and receive high point recall. Another may fire once at the start and look worse under naive timestamp matching. Two measured results show how far that gap runs.

There is an evaluation protocol called point adjustment. If any single point inside a ground-truth anomaly segment crosses the threshold, the whole segment counts as detected. Kim and four colleagues took the protocol apart at AAAI-22, and their abstract says what it lets through: “even a random anomaly score can easily turn into a state-of-the-art TAD method”. Two years later Liu and Paparrizos reran the comparison independently at NeurIPS 2024 and reported that “when comparing the Random (C) with the anomaly score generated by 32 anomaly detectors, the random score achieves a ranking of 26 under the PA-F1 measure”. Two groups, one finding. The protocol rewards noise.

The alert burden is the other half of the same failure. Drew and colleagues logged every alarm from five adult ICUs at UCSF over 31 days in March 2013: 2,558,760 unique alarms across 461 patients, an audible burden of 187 alarms per bed per day. Their results section records that “88.8% of the 12,671 annotated arrhythmia alarms were false positives.” Of the 168 true ventricular-tachycardia alarms, 93% were not sustained long enough to warrant treatment. Even the correct alerts failed the workflow test.

Evaluate events, not only points. Merge nearby alerts, define tolerance windows, measure detection delay, and count false-alarm time or episodes.

Operational incidents are intervals and workflows, not independent timestamps.

Case

Precision and recall rebuilt for anomalies that occupy a range

Real incidents occupy ranges, and the standard accuracy metrics assume they do not. Tatbul and four colleagues rebuilt those metrics at NeurIPS in 2018, and their abstract states the mismatch plainly: “Classical anomaly detection is principally concerned with point-based anomalies, those anomalies that occur at a single point in time”, whereas “many real-world anomalies are range-based, meaning they occur over a period of time”. Their model extends precision and recall so that one alert can be credited for covering an interval. It carries explicit terms for overlap, position and cardinality. A bare timestamp match has none of those.

Calendar position is modelled into the baseline before anything is called anomalous

A monitoring system that flags every holiday surge is comparing a holiday against an ordinary weekday. Official statistical agencies settled this long before anomaly detection had a name. They made the calendar a component of the expected value instead of a source of surprise.

Eurostat's seasonal adjustment guidelines, 2024 edition, define the effect exactly: “Calendar effects arise from annual differences in the number of working or trading days in a month or a quarter, or the dates or days of public holidays.” The guidelines require those effects to be filtered out before short-term movements are interpreted. They add that “a normal working day adjustment implicitly adjusts for moving national holiday effects”. Easter still needs separate treatment, because it moves between months.

The US Census Bureau builds the same reasoning into software. Its X-13ARIMA-SEATS documentation defines the category: “Holidays whose effects move between or among months (or quarters) from year to year are called moving holidays”. The program ships with regressors for Easter, Labor Day and Thanksgiving built in.

Temporal anomalies require context across time, season, operating state and recent history. A large residual is meaningful only when the expected trajectory was credible. In production statistics the credible trajectory already has the calendar inside it.

Time is part of the reference model, not merely an index on the x-axis.

Example

Temporal failure modes that ordinary row scoring misses

The order and duration of observations can carry the anomaly signal. So can the defects in the labels used to score it. Wu and Keogh examined the standard anomaly-detection benchmarks built by Yahoo, Numenta, NASA and Pei's lab, and found that most individual series carry one or more of four specific defects. Their introduction names them: “These flaws are triviality, unrealistic anomaly density, mislabeled ground truth and run-to-failure bias.” They argue that the ideal number of anomalies in a test series is one. An independent group summarised the same four defects and answered them with TSB-UAD, a replacement benchmark of 13,766 series.

  • Slow drift: Each point remains within limits, but the baseline moves persistently over several weeks.
  • Stuck sensor: Values remain plausible individually yet repeat exactly for an implausible duration.
  • Phase shift: Daily demand remains normal in shape but moves three hours later after a policy change.
  • Coordinated episode: Several sensors change moderately together, forming an unusual multivariate sequence.
  • Label window error: An incident label covers one timestamp although the operational event spans twenty minutes. Mislabeled ground truth is one of the four flaws Wu and Keogh found across the field's most-used benchmarks, not a hypothetical risk.

Visual

Five forms of temporal abnormality

The detection unit determines the model, the labels, and the alert-matching rule. A point anomaly is one timestamp with an unusual value or residual. A contextual anomaly is unusual for its season, state, or entity history. A subsequence anomaly is a short shape or motif that differs from expected temporal behavior. A collective anomaly is a set of individually plausible points forming an unusual episode. A change point is a shift in the generating regime — in mean, variance, frequency, dependency, or parameters.

The last of those runs operationally at national scale. NOAA's National Centers for Environmental Information applies change-point detection to the Global Historical Climatology Network monthly dataset: about 26,000 temperature stations in version 4, against 7,200 in v2 and v3. Its Pairwise Homogenization Algorithm “systematically evaluates each time series of monthly average surface air temperature to identify cases with abrupt shifts”, and the agency records that “shifts in monthly temperature series are detected through automated pairwise comparisons of the station series using the algorithm described in Menne and Williams (2009)”. Three properties are worth copying. The regime changes are physical and named: station moves, instrument swaps, changes in the time of observation. They are detected against correlated neighbouring stations, not against a global baseline. And the correction is published for others to use. NASA's Goddard Institute for Space Studies states that “Beginning in June 2019, with the release of GISTEMP v4, we are using the adjusted monthly mean data of NOAA/NCEI's Global Historical Climatology Network (GHCN) version 4”. The change point is not an alert here. It is a correction another agency can build on.

FigureHierarchy · 5 levels
  • Point anomaly

    One timestamp has an unusual value or residual.

    • Contextual anomaly

      A value is unusual for its season, state, or entity history.

      • Subsequence anomaly

        A short shape or motif differs from expected temporal behavior.

        • Collective anomaly

          A set of individually plausible points forms an unusual episode.

          • Change point

            The generating regime shifts in mean, variance, frequency, dependency, or parameters.

An unusual event and a changed regime are related but different targets.

Comparison

Residual alerting and change-point detection

One approach scores deviations around a baseline. Another searches for persistent regime transitions. A third conditions the whole notion of normal on operating state.

A residual anomaly detector compares observed values with expected values or distributions. It supports point and interval scores, and it depends on forecast quality. It can react to temporary spikes, and it needs seasonal context.

A change-point method partitions time where statistical behavior appears to shift. It targets persistent transitions, and it needs minimum-segment and penalty choices. It can detect mean or distribution changes, but it may locate the change only after a delay.

A state-aware model conditions normal behavior on operating mode or external context. It reduces false alerts across regimes, and it requires reliable state information. It can hide novel state transitions, and it needs a rule for unknown states.

The three are not ranked. They answer different questions.

FigureComparison · 3 columns

Residual anomaly detector

Compares observed values with expected values or distributions.

  • Supports point and interval scores
  • Depends on forecast quality
  • Can react to temporary spikes
  • Needs seasonal context

Change-point method

Partitions time where statistical behavior appears to shift.

  • Targets persistent transitions
  • Needs minimum segment and penalty choices
  • Can detect mean or distribution changes
  • May locate change after a delay

State-aware model

Conditions normal behavior on operating mode or external context.

  • Reduces false alerts across regimes
  • Requires reliable state information
  • Can hide novel state transitions
  • Needs unknown-state handling

Steps

Design a temporal anomaly evaluation

The protocol should reflect how alerts become incidents and responses. Define the event ontology: point, interval, subsequence, collective episode, or regime change. Build a contextual baseline covering season, calendar, operating state, entity history and exposure. Preserve time order, with chronological training, validation and test periods and realistic label delay. Match alerts to events with tolerance windows, merge rules, minimum duration and duplicate handling. Measure operations as event recall, precision, time to detect, alert burden and missed-event severity. Then monitor baseline drift, seasonality, missingness and state coverage after deployment.

Steps 2 and 3 have a working national implementation. A Farrington-type seasonal baseline runs every week over a database of more than 3,300 distinct organisms. Noufaily and colleagues revised it, stating their objective as being “to improve the performance of the England and Wales large scale multiple statistical surveillance system for infectious disease outbreaks with a view to reducing the number of false reports, while retaining good power to detect genuine outbreaks”. The baseline is built from the same calendar position in earlier years: the original method fits its GLM to “w timepoints centred around the timepoint located 1, 2, . . . , b years before t0”. The revision then deliberately excludes the most recent 26 weeks before the monitored week. Salmon and colleagues at the Robert Koch Institute, who reimplemented the method in R, record the reason: “it is better to exclude the last 26 weeks before t0 from the baseline in order to avoid reducing sensitivity when an outbreak has started recently”. Their implementation notes that “the newly implemented function farringtonFlexible supports the use of this original method as well as of the improved method built on suggestions made by Noufaily et al. (2012) for improving the specificity without reducing the sensitivity”. An outbreak already under way must not be allowed to inflate its own expected value.

Step 5 is where the cost of skipping this shows. The Joint Commission's Sentinel Event Alert on medical device alarm safety in hospitals, dated 8 April 2013, states that “It is estimated that between 85 and 99 percent of alarm signals do not require clinical intervention”. Its Sentinel Event database held 98 alarm-related events between January 2009 and June 2012, and the alert records the outcome: “Of the 98 reported events, 80 resulted in death, 13 in permanent loss of function, and five in unexpected additional care or extended stay.” The AHRQ Patient Safety Network reaches the same range from an independent direction: “Research has shown that 80%–99% of ECG monitor alarms are false or clinically insignificant.” Alert burden and missed-event severity are not soft metrics reported after the F1 score. They are the quantities the system is judged on.

FigureProcess · 6 steps
  1. 1. Define event ontology

    Specify point, interval, subsequence, collective episode, or regime change.

  2. 2. Build contextual baseline

    Include season, calendar, operating state, entity history, and exposure where appropriate.

  3. 3. Preserve time order

    Use chronological training, validation, and test periods with realistic label delay.

  4. 4. Match alerts to events

    Set tolerance windows, merge rules, minimum duration, and duplicate-alert handling.

  5. 5. Measure operations

    Report event recall, precision, time to detect, alert burden, and missed-event severity.

  6. 6. Monitor baseline drift

    Track residual distribution, seasonality, missingness, and state coverage after deployment.

Analogy

Listening for a wrong note, a wrong phrase, or a new key

Music goes wrong in three different ways, and a listener hears each of them differently. One wrong note is a point anomaly. A distorted phrase is a subsequence anomaly. A lasting key change resembles a regime shift.

One score will not find all three. Real systems add irregular sampling, missing data, multivariate context and delayed incident labels. And, as the ICU alarm counts show, a listener who is asked to react to every wrong note stops listening.

Choose the temporal unit that matches the event someone must investigate.

Temporal anomaly detection is an event-modeling problem

The detector needs somebody to say what a normal trajectory is, and what counts as an incident. Without both, scores cannot be evaluated against the workflow they are meant to support. Eurostat and the Census Bureau answer the first question with named calendar regressors. The England and Wales surveillance system answers the second with a baseline that refuses to look at the last 26 weeks.

Separate short deviations from persistent changes, and contextualize every alert. A strong system tells operators when evidence changed, how long it persisted, and which baseline was violated. A weak evaluation protocol will tell you a random score is state of the art.

Model the event and the response window, not only the timestamp score.

Case

Exact changepoint segmentation brought down to linear cost

Exact segmentation used to be priced out of long series. Killick and colleagues made it affordable in 2012. Their PELT algorithm returns the optimal number and location of changepoints at a cost that is, in their own abstract, “linear in the number of observations”, against existing exact methods “whose computational cost can be quadratic or even cubic”. The paper describing the R implementation, by Killick and Eckley, records the same bound for the shipped code: PELT is an “O(n) search algorithm subject to certain assumptions being satisfied, the majority of which are not particularly onerous”. The guarantee survived the trip from the paper into the package.

Key takeaways