fullseye

spc_cusum — SPC change op

使い方

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.

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(table を入力に取れる)

同カテゴリ(change)


Provenance: spc.py — SPC operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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