◄ WORLD V · SONNY 5DART 321 · a helldive at the net

THE CUSUM detect a change the instant it accumulates — one running sum

When does a stream change? The cumulative sum control scheme carries a single accumulator that adds each deviation from a target and clamps at zero: S ← max(0, S + (x−target)). While the process behaves, deviations cancel and S hovers near zero; when a real shift begins, deviations pile up in one direction and S climbs past a threshold — alarm. It is optimal in the sense of detecting a persistent shift as fast as possible for a given false-alarm rate. One number of state, no window, no history — a change detector whose memory of the past is entirely folded into a single running sum.

THE TECHNIQUE S ← max(0, S + (x−target)); alarm when S crosses h

A stream that shifts upward. The demo accumulates the deviations and fires when the running sum crosses the threshold: live demo


HISTORY & CREDIT E. S. Page, 1954 · Biometrika

“Detecting a change means comparing windows of history.” — CUSUM folds all the evidence into one accumulator; it fires the moment the drift outweighs the noise, with a single number of memory. cited

1954 · E. S. Page — “Continuous Inspection Schemes,” Biometrika: the CUSUM chart.
theory · connected to the sequential probability ratio test (Wald); optimal worst-case detection delay (Lorden, 1971).
now · quality control, fault and intrusion detection, change-point analysis, monitoring dashboards.

Evidence banked, noise cancelled, the alarm tripped when drift outweighs chance. A whole history's worth of watching, in one running sum. Page 1954

RECOMMEND FOR I-13 the change alarm, one accumulator, on the compiler

On the canonical compiler, a stream of upward deviations trips the CUSUM at step 3 once the running sum crosses the threshold:

$ i13 run op_cusum.i13 # S <- max(0, S + x); alarm when S > 3 RUN OK · 133 step(s) · peak stack 6 · call depth 4 alarm_step = 3 -- change detected; state carried is one number S
Recommend: CUSUM is the streaming change detector — one accumulator that banks evidence and fires the instant drift beats noise. i13 trips the alarm at step 3. The supplement to correctness: a correct change test that compares windows retains history; CUSUM folds it all into a single clamped sum. Honestly Kahan-adjacent (it is an accumulator with feedback, the max(0,·) being its one nonlinearity) — so not a new keeper axis — but the cleanest one-number detector in the theme, and the bridge from “summarize the stream” to “decide about the stream.”