Module pelt

Source
Expand description

PELT (Pruned Exact Linear Time) offline change point detection.

Detects structural breaks in embedding trajectories by finding timestamps where the mean vector shifts significantly.

ยงAlgorithm

  1. Define cost function as sum of squared deviations from segment mean.
  2. Dynamic programming with pruning: maintain set of candidate change points.
  3. Penalty controls sensitivity (BIC default: dim * ln(n) / 2).

Complexity: O(N) amortized per Killick et al. (2012).

Structsยง

CumulativeSums ๐Ÿ”’
Cumulative sums for O(1) segment cost computation.
PeltConfig
PELT configuration.

Functionsยง

build_cumsum ๐Ÿ”’
compute_segment_means ๐Ÿ”’
Compute mean vectors before and after a change point.
detect
Run PELT change point detection on a trajectory.
segment_cost ๐Ÿ”’
Cost of segment [start, end): sum of squared deviations from segment mean.
segment_mean ๐Ÿ”’