Computer Science

CUSUM One-Sided Change Detection

Track persistent shifts with accumulated positive deviations and an explicit alarm rule.

By Riano · Published · Updated · Report a correction

CUSUM One-Sided Change Detection

The Cumulative Sum (CUSUM) control chart is a sequential analysis technique used for monitoring change detection. It is particularly effective for identifying small but persistent shifts in a process mean. This module focuses on the one-sided positive-shift CUSUM, which accumulates positive deviations from a target value, subtracting a defined allowance at each step.

Worked Example

Consider the CUSUM calculation for the Step stream, which introduces a sudden shift: [0, 0, 0, 1, 1, 1]. We will use an Allowance of 0.25 and a Threshold of 2. We calculate the CUSUM statistic St step by step, using the formula St = max(0, St-1 + xt - k), starting with S0 = 0.

  1. Step 1: x1 = 0. S1 = max(0, 0 + 0 - 0.25) = 0.
  2. Step 2: x2 = 0. S2 = max(0, 0 + 0 - 0.25) = 0.
  3. Step 3: x3 = 0. S3 = max(0, 0 + 0 - 0.25) = 0.
  4. Step 4: x4 = 1. S4 = max(0, 0 + 1 - 0.25) = 0.75.
  5. Step 5: x5 = 1. S5 = max(0, 0.75 + 1 - 0.25) = 1.5.
  6. Step 6: x6 = 1. S6 = max(0, 1.5 + 1 - 0.25) = 2.25.

At step 6, S6 reaches 2.25, which is greater than the threshold of 2. Therefore, the first alarm index is 6. The maximum CUSUM observed is 2.25.

Experiment

You can explore how different streams and parameters affect the CUSUM trace using the interactive module at https://riano.app/module/cusum-one-sided-change-detection.

  1. Set the Stream control to Pulse.
  2. Ensure the Allowance is set to 0.25 and the Threshold to 2.
  3. Ensure the Prefix is set to 6.
  4. Observe the output and the trace. The pulse provides a brief spike of 2 at step 3. The CUSUM rises to 1.75 at step 3, but because the subsequent values are 0, the CUSUM slowly drifts back to 1.0 by step 6.
  5. Notice that the First alarm index shows No alarm because the maximum value (1.75) never reached the threshold of 2.

Limitations

This module visualizes a deterministic set of teaching streams rather than stochastic processes. Without a formal statistical null model representing in-control variations, the chosen threshold and allowance values do not establish a formal false-alarm probability (Type I error rate) or Ville-style anytime guarantee. The CUSUM algorithm assumes that observations are independent and identically distributed when a process is in control, an assumption that might be violated in real-world autocorrelated data.

References

For a comprehensive overview of the CUSUM method and its applications in statistical process control, refer to the NIST/SEMATECH e-Handbook of Statistical Methods: NIST CUSUM Control Charts. This handbook provides theoretical background and practical examples for process monitoring.

Experience it interactively

Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive CUSUM One-Sided Change Detection module.

Try CUSUM One-Sided Change Detection on Riano →

More in Computer Science