Skip to main content

Module decomposition

Module decomposition 

Source
Expand description

Seasonal-Trend decomposition using Loess (STL).

Splits a time series into trend, seasonal, and residual components: y = trend + seasonal + residual.

The implementation follows the Cleveland et al. (1990) STL algorithm:

  1. Start with seasonal = 0.
  2. Detrend: detrended = y - trend.
  3. Subseries smoothing: extract each season’s slice, apply degree-1 Loess (locally weighted polynomial regression with tricube kernel).
  4. Trend update: y - seasonal, then Loess with trend_window.
  5. Repeat for n_iter iterations.

Structs§

Decomposition
Decomposition result: y[i] = trend[i] + seasonal[i] + residual[i].
StlConfig
Configuration for the STL decomposer.
StlDecomposer
STL decomposer implementing SeasonalDecomposer.

Enums§

DecompositionError
Errors that can occur during decomposition.

Traits§

SeasonalDecomposer
Trait for seasonal decomposition strategies.

Functions§

detect_period
Detect the dominant period using autocorrelation peak finding.
detect_period_with_threshold
Detect the dominant period using autocorrelation peak finding with a caller-specified minimum ACF threshold.
stl_decompose
Perform STL decomposition.