Define the reference process, update rule and alert threshold before reading a rising trace.
CUSUM charts: accumulate small departures from a stable target
A cumulative trace needs a frozen baseline
A cumulative-sum chart can detect a sustained small departure that a point-by-point threshold misses. Start with a process metric measured at consistent intervals and a target estimated from an independent, stable baseline period. A cumulative sum of raw values will drift simply because the metric is positive; subtract the target and a reference allowance before accumulating evidence of an upward shift. Use a separate lower trace for downward shifts. P charts handle varying binomial denominators; their rate and limits should not be replaced by a CUSUM of unadjusted percentages. If observation precision or exposure changes across periods, standardize or model that change before applying a fixed CUSUM rule.
The allowance and threshold are design choices
In a tabular upper CUSUM, each new value adds its deviation from the target minus an allowance, and negative running totals reset to zero. A lower CUSUM mirrors the logic for downward movement. The allowance controls the size of shift the chart is tuned to notice; the decision threshold controls when an alert is raised. Neither number is a universal constant. Calibrate them against the operational false-alarm rate and detection delay the team can tolerate, using an appropriate baseline model. Uncertainty displays help explain how noisy short runs can be. The worked numbers below demonstrate mechanics only and must not be copied as an alert policy for another process.
A signal is a review trigger
Mark the exact first threshold crossing on the chart. Keep every earlier point and the zero resets visible; truncating the history can make the signal look instantaneous. An alert says the observed sequence is unusual under the chosen reference model, not that a particular maintenance event caused it. Event annotations need timestamps and a caution about causal interpretation. If a baseline is re-estimated after every signal, the chart can absorb the very drift it was intended to detect. Version the target, allowance, threshold and any planned reset date. When a legitimate process change establishes a new operating state, start a documented new chart rather than silently splicing scales.
Audit the measurement pipeline
A sustained run of delayed, duplicated or missing readings can resemble a process shift. Validate sampling cadence, units, sensor identity and data revision status before interpreting the trace. Time-series gaps must remain gaps or be handled by an explicit rule; inserting zero will push a lower trace down for the wrong reason. Serial correlation also changes the false-alarm behavior of a rule calibrated for independent observations. Keep an export with period ID, raw reading, target version, upper and lower cumulative values, and alert state. Chart manifests make the calculation reproducible after a dashboard or threshold update.
Worked contract
from math import isfinite
def process_shift_trace(readings: list[float], target: float,
allowance: float, threshold: float):
if (not all(isfinite(value) for value in [*readings, target,
allowance, threshold])
or allowance < 0 or threshold <= 0):
raise ValueError("finite readings, nonnegative allowance and positive threshold required")
upper = lower = 0.0
trace = []
for period_index, reading in enumerate(readings, start=1):
upper = max(0.0, upper + reading - target - allowance)
lower = max(0.0, lower + target - reading - allowance)
trace.append((period_index, upper, lower,
upper >= threshold, lower >= threshold))
return trace
depot_trace = process_shift_trace([48, 49, 52, 54],
target=47, allowance=2, threshold=8)
assert depot_trace[:2] == [(1, 0.0, 0.0, False, False),
(2, 0.0, 0.0, False, False)]
assert depot_trace[-1] == (4, 8.0, 0.0, True, False)Performance and operating cost
Updating N readings takes O(N) time and O(N) space when the full trace is retained; an online alarm needs O(1) state. The sequence reaches the illustrative upper threshold only after two larger readings accumulate. No false-alarm guarantee follows from those values. Choose target, allowance and threshold from the real measurement process and validate assumptions such as independence or expected exposure before production alerts.
Common Mistakes
- Using a target recomputed from the same drifting window being monitored.
- Copying example allowance and threshold values into a live alert without calibration.
- Filling missing readings with zero or treating duplicate periods as independent evidence.
- Calling the first alert proof of a specific cause rather than a trigger for investigation.
Validation drill
Monitor 47 daily throughput readings. Freeze a baseline version, compare an upper and lower trace, record every reset, and test how one missing day changes the alert when it is omitted versus incorrectly filled with zero.
Read next
- P charts: account for varying denominators before flagging a rate
- Time-series charts: distinguish missing days, zeros and provisional periods
- Chart annotations: align events to the right clock without claiming causality
- Chart exports: carry the data, filters and render contract together
