Principle:Dotnet Machinelearning SSA Forecasting Configuration
| Knowledge Sources | |
|---|---|
| Domains | Machine Learning, Time Series, .NET |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Singular Spectrum Analysis (SSA) forecasting configuration defines the decomposition and prediction parameters for a non-parametric time series forecasting method that separates a series into trend, oscillatory, and noise components.
Description
Singular Spectrum Analysis (SSA) is a non-parametric technique that decomposes a time series into interpretable additive components without requiring explicit specification of trend form, seasonal periods, or noise distribution. The decomposition is achieved by constructing a trajectory matrix from lagged copies of the series and applying Singular Value Decomposition (SVD) to separate signal from noise.
The key configuration parameters control the fidelity and scope of this decomposition:
- windowSize (L): The width of the sliding window used to construct the trajectory matrix. This is the single most important hyperparameter. A larger L provides finer resolution for separating oscillatory components of different frequencies, but increases computational cost and requires more data. A common heuristic is to set L between N/3 and N/2, where N is the series length.
- seriesLength (N): The size of the internal buffer that holds the modeled portion of the series. This determines how much historical data the model retains for decomposition and reconstruction.
- trainSize: The number of observations from the beginning of the series used to initially fit the SVD model. This defines the training window over which the trajectory matrix is constructed.
- horizon: The number of future time steps to forecast beyond the end of the observed series. Forecast accuracy typically degrades as the horizon increases.
- isAdaptive and discountFactor: When adaptive mode is enabled, the model can update its internal state as new observations arrive. The discount factor (between 0 and 1) controls how quickly older observations lose influence, with values closer to 0 meaning faster forgetting.
- rankSelectionMethod, rank, and maxRank: These control how many singular components are retained during reconstruction. Automatic rank selection uses heuristics to separate signal from noise components; manual rank selection allows the user to specify the exact number of components to keep.
Because SSA is non-parametric, it handles seasonality, trend changes, and quasi-periodic behavior without requiring the user to specify a parametric model (e.g., ARIMA orders or Fourier terms).
Usage
Use SSA forecasting configuration when the time series exhibits complex seasonality, trend shifts, or non-stationary behavior that is difficult to capture with parametric models. Set windowSize to roughly half the series length for maximum decomposition resolution, or to slightly more than the longest seasonal period if computational cost is a concern. Set seriesLength large enough to capture at least two full seasonal cycles. Set trainSize to the number of historical observations available for initial model fitting.
Theoretical Basis
Trajectory matrix construction: Given a time series x_1, x_2, ..., x_N and window size L, the trajectory matrix X is formed by sliding the window across the series:
X = | x_1 x_2 x_3 ... x_K |
| x_2 x_3 x_4 ... x_K+1 |
| x_3 x_4 x_5 ... x_K+2 |
| ... ... ... ... ... |
| x_L x_L+1 x_L+2 ... x_N |
where K = N - L + 1
The matrix X has dimensions L x K.
SVD decomposition: The trajectory matrix is decomposed via SVD:
X = U * S * V^T = Σ (i=1 to L) σ_i * u_i * v_i^T
where σ_1 >= σ_2 >= ... >= σ_L >= 0 are the singular values, u_i are the left singular vectors, and v_i are the right singular vectors. Each rank-1 matrix σ_i * u_i * v_i^T represents an elementary component of the series.
Component grouping and reconstruction: The first r singular components capture the signal (trend + oscillations):
X_signal = Σ (i=1 to r) σ_i * u_i * v_i^T
X_noise = Σ (i=r+1 to L) σ_i * u_i * v_i^T
The reconstructed series is obtained by diagonal averaging (anti-diagonal averaging) of X_signal.
Forecasting via recurrence formula: The last row of the left singular vectors provides coefficients for a linear recurrence:
x_hat(n+1) = Σ (j=1 to L-1) a_j * x(n+1-j)
where a_j are derived from the selected left singular vectors:
a = (1 / (1 - v^2)) * Σ (i=1 to r) π_i * u_i(truncated)
v^2 = Σ (i=1 to r) π_i^2, π_i = last element of u_i
This recurrence relation extrapolates the signal components into the future for the specified horizon.