Papers
Topics
Authors
Recent
Search
2000 character limit reached

MOSUM: Sliding Window Sum & Change Detection

Updated 15 November 2025
  • Moving Sum (MOSUM) is a sliding-window operation that computes summations over sequential data segments, fundamental in signal processing and change-point detection.
  • It employs efficient recurrence relations such as the subtract-old/add-new scheme and optimized algorithms like DEW to ensure O(1) per output and minimal memory usage.
  • Advanced implementations, including parallel vectorized methods using semidirect products, facilitate high-performance computations in large-scale and high-dimensional data analysis.

A moving sum (MOSUM) scheme comprises sliding-window computations where a function—typically summation or related linear operations—traverses a stream of data, yielding iterated windowed outputs. Moving sums feature extensively in natural sciences, engineering, economics, and computational practice, both as low-level primitives in time-series signal processing and as core ingredients of statistical change-detection algorithms. The computational and statistical properties of MOSUM approaches have spurred broad theoretical development, unifying perspectives across sequential and batched computation, parallel and vectorization strategies, and foundational algebraic structures.

1. Formal Definition and Classical Recurrence

Given a data stream (x1,x2,x3,)(x_1, x_2, x_3, \dots) and window size ww, the moving sum at position nn is: Sn=i=nw+1nxi,nwS_n = \sum_{i = n-w+1}^{n} x_i, \qquad n \ge w Initialization proceeds with: Sw=i=1wxiS_w = \sum_{i=1}^w x_i Then classical recurrence exploits

Sn+1=Sn+xn+1xnw+1,nwS_{n+1} = S_n + x_{n+1} - x_{n-w+1}, \quad n \ge w

This "subtract-old/add-new" recurrence yields O(1)O(1) time per output, O(w)O(w) working memory, and is used universally for streaming windowed summation (Maslen et al., 30 Aug 2025).

2. Sequential Algorithms: Double-Ended Window (DEW) and Complexity Bounds

A new low-latency sequential scheme ("Double-Ended Window," DEW, see Ch. 2–4 of (Maslen et al., 30 Aug 2025)) achieves O(3N)O(3N) work for NN outputs, with worst-case constant latency per windowed sum. The DEW algorithm organizes two stack-like buffers for efficient online input/output synchronization; it provably minimizes auxiliary work in the strict streaming regime. The monograph demonstrates that no sequential windowed-sum approach with fixed-latency output can improve on this $3N$ additions bound without increasing memory beyond two ww-long buffers. Precise recurrence relations and step-by-step complexity analysis reside in subsequent chapters (not included here).

3. Parallel and Vectorized MOSUM via Semidirect Products

Part III of the monograph (Maslen et al., 30 Aug 2025) generalizes MOSUM calculation for parallel/vector contexts using semidirect product algebra. For batch-computation of windowed sums across positions, each input xix_i is encoded as

Mi=(1xi 01)M_i = \begin{pmatrix} 1 & x_i \ 0 & 1 \end{pmatrix}

and full-window products are exponentiated using addition-chain or divide-and-conquer schedules. Algorithms such as Brauer’s or Thurber’s methods support logarithmic depth (O(logN)O(\log N)), O(N)O(N) total work, and explicit vectorization. These constructions are correct for all associative operators, with source code and matrix formulas developed in Chapter 7–8.

4. Algebraic Foundations: Semi-Associativity, Correctness, and Domain of Validity

The monograph (Maslen et al., 30 Aug 2025) introduces semi-associativity (Ch. 6) as the algebraic backdrop enabling decomposition and reordering of windowed recurrences. For addition on R\mathbb{R} (or standard data types), associativity guarantees that both streaming (sequential, recurrence-based) and batch (parallel, semidirect-product) schemes yield outputs identical to the sliding-window definition. Correctness proofs and algebraic lemmas systematize practitioner heuristics for parallelizing recurrent computations.

5. MOSUM in Statistical Change Point Detection

MOSUM statistics are central in change-point detection, modeling, and segmentation. The archetype is the difference of adjacent windowed sums: Dn(i)=1αn[j=ii+αn1Xjj=i+αni+2αn1Xj]D_n(i) = \tfrac{1}{\alpha_n} [ \textstyle\sum_{j=i}^{i+\alpha_n-1} X_j - \sum_{j=i+\alpha_n}^{i+2\alpha_n-1} X_j ] as in the PULSE criterion (Zhao et al., 2020). Statistical treatments generalize to robust/score-type variants (Kirch et al., 2022), regression parameters (Kirch et al., 2022), or covariance-matrix estimators for high-dimensional time series under factor models (Barigozzi et al., 2024).

Algorithmic variants:

  • Double averaging of consecutive MOSUMs yields trapezoidal signal shapes underlying ridge-ratio change detection (Zhao et al., 2020).
  • 2\ell^2-aggregation across multiple series or spatial clusters enhances power for dense/high-dimensional changes; Two-Way MOSUM generalizes spatial scanning (Li et al., 2022).
  • Multiscale MOSUM algorithms traverse (position, bandwidth)-triangles, systematically extracting change-points, circumventing arbitrary bandwidth choice (Levajkovic et al., 2021).

Consistency, minimax localization, and thresholding principles follow from limit theory (extreme-value laws, invariance principles) across mean, regression, and covariance-change scenarios.

6. Computational Performance, Implementations, and Benchmarks

Empirical studies in (Maslen et al., 30 Aug 2025) and related work confirm the efficiency of sequential and parallel MOSUM:

  • The DEW algorithm beats classical two-stack and DABA schemes in end-to-end latency on streaming hardware for moderate window sizes.
  • Vectorized semidirect-product implementations achieve 80–90% of peak memory bandwidth on modern CPUs/GPUs, with scalability up to thousands of inputs per window.
  • Hybrid strategies (DEW for small ww, vector/parallel for large ww) optimize throughput.

Tables of performance metrics and practical timings are documented in the respective chapters and benchmark galleries, with implementations available in packages such as mosum and mscp.

Algorithm Work (Additions) Latency per Output Memory Usage
Classical Recurrence O(N)O(N) O(1)O(1) O(w)O(w)
Double-Ended Window O(3N)O(3N) constant O(w)O(w) (2 buffers)
Parallel/Vectorized O(N)O(N) O(logN)O(\log N) (depth) typically O(w)O(w)

Efficiency claims and optimality proofs are derived under associativity and strict streaming constraints.

7. Application Domains, Limitations, and Extensions

Moving sums are foundational in real-time signal processing, financial analytics, genomics (read-depth windows), change-point analysis, and high-throughput data segmentation. Extensions span:

  • Statistical formulations—robust M-estimation, regression, Poisson/INARCH modeling.
  • Bandwidth selection, window-size adaptation, and multiscale schemes (Levajkovic et al., 2021).
  • High-dimensional 2\ell^2 and spatially adaptive procedures (Li et al., 2022), covariance-break detection in large factor models (Barigozzi et al., 2024). Limitations of MOSUM approaches center on narrow-signal detection (changes closer than window size) and heavy-noise scenarios. Innovations in iterative, multi-scale, and spatially adaptive schemes address these to varying degrees. All core algorithmic and theoretical properties depend on associative operators and the isolation of change events within windowed neighborhoods.

MOSUM remains both a computational primitive and a unifying principle for efficient, theoretically grounded sliding-window calculations and change-point estimation in contemporary data analysis.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Moving Sum (MOSUM) Scheme.