Skip to main content
Time series signal decomposition involves breaking down an original time series into its constituent components. By decomposing the time series, we can gain insights into underlying patterns, trends-cycles, and seasonal effects, enabling improved understanding and forecasting accuracy. This notebook will show how to use the NHITS/NBEATSx to extract these series’ components. We will:
- Installing NeuralForecast.
- Simulate a Harmonic Signal.
- NHITS’ forecast decomposition.
- NBEATSx’ forecast decomposition.
You can run these experiments using GPU with Google Colab. Open In Colab

1. Installing NeuralForecast

2. Simulate a Harmonic Signal

In this example, we will consider a Harmonic signal comprising two frequencies: one low-frequency and one high-frequency.

3. NHITS decomposition

We will employ NHITS stack-specialization to recover the latent harmonic functions. NHITS, a Wavelet-inspired algorithm, allows for breaking down a time series into various scales or resolutions, aiding in the identification of localized patterns or features. The expressivity ratios for each layer enable control over the model’s stack specialization.

4. NBEATSx decomposition

Here we will employ NBEATSx interpretable basis projection to recover the latent harmonic functions. NBEATSx, this network in its interpretable variant sequentially projects the signal into polynomials and harmonic basis to learn trend TT and seasonality SS components: y^[t+1:t+H]=θ1T+θ2S\hat{y}_{[t+1:t+H]} = \theta_{1} T + \theta_{2} S In contrast to NHITS’ wavelet-like projections the basis heavily determine the behavior of the projections. And the Fourier projections are not capable of being immediately decomposed into individual frequencies.

References