Quarantine suspicious observations. Accept a new baseline only after a persistent run in the same direction.
Comma, space, or newline separated numbers. Sample: two sustained changes and four isolated shocks.
Time, causality, and failure modes
The first eight observations initialize the reference. Each subsequent score uses the median and median absolute deviation of accepted earlier values. Suspected anomalies do not contaminate the reference.
A short run becomes a spike when a later value returns inside the envelope or changes direction. A sustained run becomes a shift at confirmation. Its earlier points are then relabeled retrospectively. Unfinished tails remain pending.
Slow drift, periodic signals, bad warm-up data, and bursts longer than the confirmation length can fool this detector. It is a deterministic heuristic, not a calibrated statistical test. Scores are not probabilities.
O(n·w log w) time with this sorting-based reference; O(w+p) detector state, plus O(n) output for the chart.