---
kind: concept
slug: series-decomposition
title: Series decomposition
summary: >-
  Splits a series into parts modelled separately: a moving-average trend and remainder (DLinear), learned trend and seasonal features (CoST), or level, growth and season peeled off inside a network (ETSformer). DLinear beats plain Linear in 21 of 36 Table 2 cells. DLinear's MSE is lower than ETSformer's in all 24 rows of ETSformer's table. Author-reported, mostly single runs.
tags: [time-series, forecasting, decomposition, linear-model]
papers: ["2202.01381", "2202.01575", "2205.13504"]
related: [time-series-forecasting, direct-multi-step-forecasting, multi-layer-perceptron, attention-mechanism, contrastive-learning, frequency-domain-learning]
status: draft
updated_at: 2026-11-01
---

## Overview

Series decomposition splits one series, or its features, into parts that are
easier to model. Three forms appear in these cards.

An explicit split takes a smooth trend, with a moving average, and calls the
remainder the part the trend does not explain. The paper calls that remainder
"seasonal" [arxiv:2205.13504 §4]. The split is borrowed from Autoformer and
FEDformer, which the paper credits [arxiv:2205.13504 §3]. A learned split
subtracts nothing from the input. The encoder maps the input to two sets of
features, one trend-like and one seasonal-like, and each set is trained with
its own loss [arxiv:2202.01575 §3]. A third form peels parts off inside the
network. Each encoder stack removes a seasonal part and a growth part from its
residual, and the decoder combines the level, growth and season it kept
[arxiv:2202.01381 §4.1].

The explicit form is a preprocessing step. Each part is forecast by its own
model, and the two forecasts are summed [arxiv:2205.13504 §4]. The learned form
produces features for a shared regressor. The paper pretrains the encoder with
contrastive losses and fits a ridge regression on the frozen features
[arxiv:2202.01575 §4.1]. The residual form has no separate regressor. The
decoder projects the summed growth and season and adds the level
[arxiv:2202.01381 §4.1.3]. In all forms the choice of smoother or feature
design, and the choice of model for each part, are design decisions.

Keep decomposition apart from level shifting. Subtracting the last observed
value, as NLinear does, changes the level of the input but does not split it
into parts [arxiv:2205.13504 §4]. ETSformer's level is different: it is a
component of its output, smoothed from the data and held over the horizon
[arxiv:2202.01381 §4.1.2]. See Variants.

The evidence is three cards that do not share a protocol.
[arxiv:2205.13504] trains end-to-end linear forecasters with a look-back of 336
and one run per setting [app. B.2] [tab. 2]. [arxiv:2202.01575] reports a
frozen encoder with a ridge head and does not run the linear baselines [§4.1]
[tab. 1]. [arxiv:2202.01381] picks its look-back and K on validation, reports
the mean of three runs, and compares with Transformer and recurrent forecasters
rather than linear ones [§5] [app. C.1]. Every number below is author-reported.
See Contradictions before comparing across them.

## Variants

### Moving-average trend and remainder (DLinear)

The input window is smoothed with a moving average of kernel size 25. Edge
values are repeated at both ends so the length stays the same
[arxiv:2205.13504 §4] [arxiv:2205.13504 app. B.2]. The trend is the smoothed
series, and the remainder is the input minus the trend [arxiv:2205.13504 §4].
Two separate linear layers map each part to the forecast horizon, and the
outputs are summed. Card: [Are Transformers Effective for Time Series Forecasting?](/papers/2205.13504).

The paper uses kernel 25 [arxiv:2205.13504 app. B.2], and the card records no
other kernel sizes. On the main table, DLinear beats plain Linear in more cells
than it loses, as counted in "When to use which".

### Plain linear, no split (for comparison)

The paper's plain Linear model has no decomposition. One linear layer maps the
whole window to the horizon [arxiv:2205.13504 §4]. It is the reference for
measuring what the split adds.

### Not a decomposition: subtract the last value (NLinear)

The last observed value is subtracted from the window, the linear layer runs
on the offsets, and the value is added back [arxiv:2205.13504 §4]. The stated
aim is to reduce the shift between training and test distributions
[arxiv:2205.13504 app. D.1]. Its trend is not split off, so it belongs with
level handling. The paper reports it alongside DLinear as a separate model
[arxiv:2205.13504 tab. 2].

### Learned trend and seasonal features (CoST)

The encoder's output has `d = 320` channels, split into a trend part and a
seasonal part of 160 channels each [arxiv:2202.01575 §3]. The trend part is the
average of `L+1` causal convolutions whose kernel sizes are powers of two, from
1 up to `2^L` [arxiv:2202.01575 §3.1]. The seasonal part takes a discrete
Fourier transform over time, applies a learnable complex map to each frequency
bin, and transforms back [arxiv:2202.01575 §3.2]. The trend part is trained
with a MoCo-style contrastive loss over time steps. The seasonal part is
trained with amplitude and phase contrastive losses over frequency bins
[arxiv:2202.01575 §3.1] [arxiv:2202.01575 §3.2]. The two losses are combined
with a weight `alpha` [arxiv:2202.01575 §3]. After pretraining, the encoder is
frozen and a ridge regression predicts the horizon [arxiv:2202.01575 §4.1].
Card: [CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting](/papers/2202.01575).

### Residual peeling inside the network (ETSformer)

Each encoder stack takes the residual from the stack before it. It first
extracts a seasonal part with frequency attention, which keeps the K Fourier
bases with the largest amplitude for each dimension, and subtracts it. It then
extracts a growth part with multi-head exponential smoothing attention and
subtracts that. A smoothing equation updates the level, using the growth and
season from the same stack [arxiv:2202.01381 §4.1.2] [arxiv:2202.01381 §4.2.2].
In the decoder, each stack damps its last growth state with a learned factor,
extends its season past the window on the same bases, and the last level is
held flat over the horizon [arxiv:2202.01381 §4.1.3] [arxiv:2202.01381 §4.2.2].
The paper combines the summed growth and season with one linear map and adds
the level to the result [arxiv:2202.01381 §4.1]. Card: [ETSformer: Exponential Smoothing Transformers for Time-series Forecasting](/papers/2202.01381).

No period is set by hand in this form: the bases are chosen by amplitude
[arxiv:2202.01381 §4.2.2]. The paper's ablation, at horizon 24 only, shows that
removing the season hurts most on ETTh2, ECL and Traffic, and removing the
level hurts most on ETTm2 [arxiv:2202.01381 tab. 2].

## When to use which

Counts for DLinear are from its MSE values, one run per setting
[arxiv:2205.13504 tab. 2]. The CoST figures are from its own tables, with the
same caveat [arxiv:2202.01575 tab. 1] [arxiv:2202.01575 tab. 3]. The ETSformer
figures come from its main table, with the same caveat
[arxiv:2202.01381 tab. 1].

| Situation | Use | Why |
|---|---|---|
| Want the explicit split in an end-to-end linear model | DLinear | On Table 2, DLinear has lower MSE than Linear in 21 of 36 cells, equal in 10, and higher in 5 [arxiv:2205.13504 tab. 2]. The gains are largest on Exchange-Rate and in every ETTm1 and ETTm2 cell. Electricity and Traffic show no difference. |
| Datasets like the Exchange-Rate, ETTm1 or ETTm2 benchmarks, where the paper's results favour the split | DLinear | DLinear beats Linear in every Exchange-Rate cell, the largest gap being T=720 (0.643 vs 0.964 MSE), and in every ETTm1 and ETTm2 cell [arxiv:2205.13504 tab. 2]. |
| Level shifts between train and test, with ETT-like data | NLinear | NLinear has the lowest MSE among the models in Table 2 on several ETTh1 and ETTh2 cells at long horizons [arxiv:2205.13504 tab. 2]. Its mechanism is level subtraction, not a split, so it is not evidence for decomposition [arxiv:2205.13504 §4]. |
| Need a cheap model for many series | DLinear or Linear | The paper's cost table compares DLinear with Transformers, not with plain Linear. DLinear uses 0.04G MACs and 139.7K parameters on Electricity at L=96, T=720 [arxiv:2205.13504 tab. 8]. The cost of the moving average alone is not isolated. |
| Want a learned representation, with a cheap regressor on frozen features | CoST | CoST reports average multivariate MSE 0.590, against 0.750 for TS2Vec [arxiv:2202.01575 tab. 1]. Its end-to-end supervised version of the same encoder reports 1.376 [arxiv:2202.01575 tab. 3]. Pretraining takes 262.78 s on one A100, against 91.9 s for TS2Vec [arxiv:2202.01575 tab. 6] [arxiv:2202.01575 app. F]. |
| Trend branch, without a hand-picked look-back | CoST with the mixture of AR experts | The paper's ablation gives multivariate MSE 0.789 with the mixture and 0.882 with one expert [arxiv:2202.01575 tab. 3]. The mixture averages causal convolutions of several kernel sizes instead of choosing one [arxiv:2202.01575 §3.1]. |
| Want level, growth and season as separate parts inside an attention model | ETSformer | The decoder sums growth and season and adds the level [arxiv:2202.01381 §4.1.3]. The interpretability check is on a synthetic series with known components, and is qualitative [arxiv:2202.01381 §5.3]. |
| Repeating cycles, with the period not fixed by hand | ETSformer | The K largest bases are kept per dimension, with K searched over 0 to 3 [arxiv:2202.01381 §4.2.2] [arxiv:2202.01381 tab. 3]. |
| Long look-back, where attention cost matters | ETSformer, with caution | Its smoothing attention runs as an FFT convolution in O(L log L) [arxiv:2202.01381 §4.2.1] [arxiv:2202.01381 app. A]. Its efficiency comparison is a figure with no numbers in the text [arxiv:2202.01381 app. H]. |
| Series where variates interact | Not decided by this concept | The paper's linear models share weights across variates and model no cross-variate correlation [arxiv:2205.13504 §4]. Decomposition does not address this. |

The paper's gaps between Linear and DLinear are often small. ETTh1 at T=96 gives
0.375 MSE for Linear and DLinear, with NLinear at 0.374
[arxiv:2205.13504 tab. 2]. The paper gives no spread for these values, so a
gap of that size is not a reliable ranking.

## Implementation sketch

Language-agnostic sketch of the moving-average split. The paper's kernel and
edge handling are in [arxiv:2205.13504 app. B.2]. The parts are then passed to
separate forecasters, as described in Variants.

```pseudocode
# Split a window into trend and remainder  [arxiv:2205.13504 §4]
# Input: x (B, L, C)   Output: trend, remainder, each (B, L, C)

def decompose(x, kernel=25):
    # Smooth along time; edge values are repeated so the length stays L
    # [arxiv:2205.13504 app. B.2]
    trend = moving_average(x, kernel)
    # Whatever the trend does not explain  [arxiv:2205.13504 §4]
    remainder = x - trend
    return trend, remainder

# Forecast each part with its own layer, then sum  [arxiv:2205.13504 §4]
trend, remainder = decompose(x)
y_hat = trend_layer(trend) + remainder_layer(remainder)
```

The learned split works on encoder features instead of the raw input. It is
the sketch for the CoST variant, not for DLinear.

```pseudocode
# Split encoder features into trend and seasonal parts  [arxiv:2202.01575 §3]
# Input: v (B, T, d), d = 320   Output: trend, season, each (B, T, d/2)

def disentangle(v, kernels):
    # Trend: average of causal convolutions with kernel sizes 2^i  [§3.1]
    trend = mean([causal_conv(v, k) for k in kernels])
    # Seasonal: Fourier transform over time  [§3.2]
    freq = rfft(v, dim=time)                    # (B, F, d) complex
    # One learned complex map per frequency bin  [§3.2]
    freq = einsum("bfd,fdk->bfk", freq, A) + B  # A: (F, d, d/2), B: (F, d/2)
    season = irfft(freq, n=T, dim=time)         # (B, T, d/2)
    return trend, season
```

The residual form is a third sketch. Parts are peeled off one stack at a
time, and the order matters: the season comes out before the growth
[arxiv:2202.01381 §4.1.2]. The sketch follows the paper's text, not the code.

```pseudocode
# One encoder stack of residual peeling  [arxiv:2202.01381 §4.1.2]
# Input: residual (B, L, d), level (B, L, m)
# Output: season, growth, updated level, residual for the next stack

def peel_stack(residual, level, K):
    # Seasonal part: keep the K largest Fourier bases  [§4.2.2]
    season = frequency_attention(residual, K)   # (B, L + H, d)
    residual = residual - season[:, :L]
    # Growth part: exponential smoothing on successive differences  [§4.2.1]
    growth = exp_smoothing_attention(residual)  # (B, L, d)
    residual = layer_norm(residual - growth)
    # Level: smoothing update using this stack's growth and season  [§4.1.2]
    level = level_update(level, growth, season[:, :L])
    return season, growth, level, residual
```

## Contradictions

**Reported MSE at the same horizon, DLinear vs CoST.** The two papers report
different values for the same dataset and horizon, under different protocols.
At each horizon below, DLinear's MSE in Table 2 is lower than CoST's MSE in
Table 1 [arxiv:2205.13504 tab. 2] [arxiv:2202.01575 tab. 1]:

- ETTh1, T=336: CoST 0.812, DLinear 0.439.
- ETTh1, T=720: CoST 0.970, DLinear 0.472.
- ETTh2, T=720: CoST 1.971, DLinear 0.605.
- Electricity, T=336: CoST 0.196, DLinear 0.169.
- Electricity, T=720: CoST 0.232, DLinear 0.203.
- Weather, T=720: CoST 0.533, DLinear 0.323.

Neither paper runs the other's model. CoST's table has no DLinear row, and
DLinear's table has no CoST row [arxiv:2202.01575 tab. 1] [arxiv:2205.13504 tab. 2].
The protocols differ: CoST uses a frozen encoder with a ridge head, and DLinear
trains end-to-end with look-back 336. This page does not resolve the gap.

**Reported MSE at the same horizon, DLinear vs ETSformer.** The two papers
share six datasets: ETTm2, Electricity (ECL in the ETSformer table), Exchange,
Traffic, Weather and ILI. Neither paper runs the other's model
[arxiv:2202.01381 tab. 1] [arxiv:2205.13504 tab. 2]. On those six datasets,
DLinear's reported MSE is lower than ETSformer's in every one of the 24 rows of
the ETSformer table. Two examples: Traffic at T=96, 0.607 for ETSformer and
0.410 for DLinear; ETTm2 at T=720, 0.414 and 0.397
[arxiv:2202.01381 tab. 1] [arxiv:2205.13504 tab. 2]. The protocols differ:
ETSformer picks its look-back from 96, 192, 336 and 720 on validation
[arxiv:2202.01381 tab. 3] [arxiv:2202.01381 app. C.1], while DLinear fixes
L=336 [arxiv:2205.13504 app. B.2]. This page does not resolve the gap.

**Linear look-back inside the DLinear paper.** Table 4 uses look-back 96 for
Linear and Table 2 uses 336, so their Linear numbers differ
[arxiv:2205.13504 tab. 4] [arxiv:2205.13504 tab. 2]. That affects the Linear
baseline, not the decomposition comparison within Table 2.

## Papers

- [Are Transformers Effective for Time Series Forecasting?](/papers/2205.13504): proposes LTSF-Linear, including DLinear (moving-average split plus two linear layers) and NLinear (level subtraction), and compares them with Transformer forecasters on nine benchmarks.
- [ETSformer: Exponential Smoothing Transformers for Time-series Forecasting](/papers/2202.01381): replaces self-attention with exponential smoothing attention for growth and frequency attention for seasonality, and forecasts level, growth and season from separate parts; compares with Transformer and recurrent forecasters.
- [CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting](/papers/2202.01575): learns trend and seasonal representations with a time-domain and a frequency-domain contrastive loss, then fits a ridge regressor on the frozen features; compares with representation learners and end-to-end forecasters.
