philipperemy / n-beats

Keras/Pytorch implementation of N-BEATS: Neural basis expansion analysis for interpretable time series forecasting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question on Equation(3) in paper

iLampard opened this issue · comments

Hi, I have a question on implementing equation(3).

According to the code in "seasonality_model" in nbeats_keras/model.py, the summation is over dim of thetas, i.e.,

p = dim of theta
y = \sum_{i=1}^{p/2} theta_{i=1:p/2} * cos (2*pi i t) + theta_{i=p/2:p} * sin (2pi *i t)

However in the paper(eqn 3 on page 5) the summation is over dim of time vector, i.e. H.

May i know if it is a typo in the paper or i misunderstand it.

Thanks in advance.

Regarding the seasonality block implementation:

While implementing the paper, both in pytorch and keras, the goal was to stay as close as possible to the authors' view.
Correspondance with the authors confirmed that their implementation is of dimensionality 2H (H being the forecast length) so that the parameters are not shared between backcast and forecast.
We understand that one would want to try a different implementation where the backcast part of the theta layer of the seasonality block is not of dimension H. We therefore implemented the option nb_harmonics to suit such use cases (using nb_harmonics = backcast_length is then a special case of this feature).

Merci Rémy.

@iLampard my pleasure.