autoregressive_cusum

Autoregressive CUSUM change-point detection algorithm.

class pysatl_cpd.algorithms.online.cusum.algorithm.autoregressive_cusum.AutoregressiveCusumConfiguration(*, learning_period_size=0, adaptive_estimation=True, delta=0.0, autoreg_order=1, autoreg_window=None)[source]

Bases: GeneralizedCUSUMConfiguration

Configuration for the autoregressive CUSUM algorithm.

Variables:
  • delta – Sensitivity parameter for the Page change-point function.

  • autoreg_order – Number of AR lags (> 0).

  • autoreg_window – Maximum observations retained for AR fitting (must exceed autoreg_order when provided).

Parameters:
  • learning_period_size (int)

  • adaptive_estimation (bool)

  • delta (float)

  • autoreg_order (int)

  • autoreg_window (int | None)

delta: float = 0.0
autoreg_order: int = 1
autoreg_window: int | None = None
__post_init__()[source]

Validate configuration after initialisation.

Raises:

ValueError – If learning_period_size is non-positive, autoreg_order is non-positive, learning_period_size is too small, or autoreg_window is too small.

Return type:

None

__init__(*, learning_period_size=0, adaptive_estimation=True, delta=0.0, autoreg_order=1, autoreg_window=None)
Parameters:
  • learning_period_size (int)

  • adaptive_estimation (bool)

  • delta (float)

  • autoreg_order (int)

  • autoreg_window (int | None)

Return type:

None

class pysatl_cpd.algorithms.online.cusum.algorithm.autoregressive_cusum.AutoregressiveCusumState(*, is_in_learning_period=False, statistics)[source]

Bases: GeneralizedCUSUMState[EstimatesGaussianAR]

State snapshot of the autoregressive CUSUM algorithm.

Parameters:
__init__(*, is_in_learning_period=False, statistics)
Parameters:
Return type:

None

class pysatl_cpd.algorithms.online.cusum.algorithm.autoregressive_cusum.AutoregressiveCUSUM(learning_period_size, delta, autoreg_order=1, autoreg_window=None, adaptive_estimation=True)[source]

Bases: GeneralizedCUSUM[UnivariateNumericArray, AutoregressiveCusumConfiguration, AutoregressiveCusumState, EstimatesGaussianAR, UnivariateNumericArray]

CUSUM detector for univariate autoregressive Gaussian time series.

Parameters:
  • learning_period_size (int) – Number of initial training observations.

  • delta (float) – Sensitivity parameter for the Page CUSUM statistic.

  • autoreg_order (int) – Number of AR lags (> 0).

  • autoreg_window (int | None) – Max observations for AR fitting (None = unbounded).

  • adaptive_estimation (bool) – Whether to re-fit AR coefficients online after training.

__init__(learning_period_size, delta, autoreg_order=1, autoreg_window=None, adaptive_estimation=True)[source]
Parameters:
  • learning_period_size (int)

  • delta (float)

  • autoreg_order (int)

  • autoreg_window (int | None)

  • adaptive_estimation (bool)

Return type:

None

property name: str

Human-readable algorithm name.

property configuration: AutoregressiveCusumConfiguration

Current algorithm configuration.

Return type:

AutoregressiveCusumConfiguration

property state: AutoregressiveCusumState

Materialise an immutable state snapshot.

Return type:

AutoregressiveCusumState

process(observation)[source]

Ingest one observation and return the change-point statistic.

Parameters:

observation (double | int | float | ndarray[tuple[int], dtype[double]]) – New observation (must be dim=1).

Return type:

double | int | float

Raises:

ValueError – If observation is not dim=1.