spc_cusum — SPC change op

Data kinds: signaltable

Call: import fullseye as fs; fs.ledger.spc_cusum(signal, target, k=0.5, h=5.0) (to call the implementation directly, import spc; spc.spc_cusum(signal, target, k=0.5, h=5.0); from the registry, opsspc.get("spc_cusum"))

Usage

Tabular CUSUM chart for individual measurements.

`signal` is a 1-D series of individual measurements. With a reference value

`target, a slack k` (in the same units as the measurements — commonly half

the shift you want to catch) and a decision interval `h`::

C+_i = max(0, C+_{i-1} + (x_i - target) - k)

C-_i = max(0, C-_{i-1} - (x_i - target) - k)

starting from `C+_0 = C-_0 = 0, alarming at index i when C+_i > h` or

`C-_i > h. Returns a dict with the c_plus / c_minus` arrays, the

integer `alarms indices, the first alarm index (or -1`), and the echoed

`target / k / h`.

Ground truth (pinned in the tests): a series constant at `target` keeps

`C+ == C- == 0; after a sustained upward step of size d > k` the upper sum

grows at exactly `d - k` per sample.

Raises `ValueError`: a non-1-D / empty *signal*, a non-finite

*target* / *k* / *h*, a negative *k*, or a non-positive *h*.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

poc_spcpy -3.11 examples/poc_spc.py

Ops the type connects to (they accept table as input)

Same category (change)

spc_ewma


*Provenance: spc.py — SPC operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.