Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Sktime Pytorch forecasting Decomposition Linear

From Leeroopedia


Knowledge Sources
Domains Time_Series, Forecasting, Deep_Learning, Signal_Decomposition
Last Updated 2026-02-08 09:00 GMT

Overview

DLinear (Decomposition-Linear) is a lightweight forecasting architecture that decomposes time series into trend and seasonal components using a moving average filter, then applies separate linear layers to each component to produce long-term predictions.

Description

DLinear challenges the assumption that complex Transformer-based architectures are necessary for long-term time series forecasting. The model consists of three stages: (1) series decomposition via a moving average kernel that separates the input into a trend component and a seasonal (remainder) component, (2) independent linear projections where each component is mapped from the context length to the prediction length by a separate linear layer, and (3) summation of the projected trend and seasonal outputs to produce the final forecast.

The decomposition uses a SeriesDecomposition module that applies a moving average with a configurable kernel size. The moving average extracts the trend, and the seasonal component is obtained by subtracting the trend from the original signal. This simple decomposition makes each sub-problem easier for a linear layer to learn.

DLinear supports two modes: shared mode (default), where a single pair of linear layers handles all variates simultaneously, and individual mode, where each variate (feature channel) gets its own pair of linear layers. The individual mode is useful when variates have very different characteristics.

The model supports quantile predictions through QuantileLoss integration. When quantile loss is used, the output dimension is expanded to prediction_length * n_quantiles, and the output is reshaped accordingly.

Weight initialization uses a constant value of 1/L (where L is the context length) for all linear layer weights, with biases initialized to zero. This gives each input time step equal initial influence on each output time step.

Usage

Use DLinear for long-term time series forecasting when: (1) a simple, fast, and interpretable baseline is needed, (2) the time series exhibits clear trend and seasonal patterns that benefit from explicit decomposition, (3) computational resources are limited compared to Transformer-based models. This is an experimental model implemented on the TslibBaseModel v2 interface and currently supports only continuous features.

Theoretical Basis

Series decomposition via moving average:

xtrend=AvgPool(x,k),xseasonal=xxtrend

where k is the moving average kernel size (default 25). The AvgPool operation uses padding to preserve the sequence length.

Shared linear projection (default mode):

y^trend=WtxtrendT,y^seasonal=WsxseasonalT

where Wt,WsH×L map from context length L to prediction length H. The input is permuted to shape (batch, features, time) before applying the linear layers.

Individual linear projection (per-variate mode): For each variate i:

y^trend,i=Wt,ixtrend,i,y^seasonal,i=Ws,ixseasonal,i

Final prediction:

y^=y^trend+y^seasonal

Weight initialization:

Wij=1L,bj=0

This uniform initialization ensures that the model starts by treating all lookback positions equally.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment