philipperemy / n-beats

Keras/Pytorch implementation of N-BEATS: Neural basis expansion analysis for interpretable time series forecasting.
MIT License
864 stars 166 forks source link

Incorporating deterministic exogenous features #49

Closed dcdorukcengiz closed 2 years ago

dcdorukcengiz commented 3 years ago

Hi,

First off, thank you very much for this fantastic repo.

I have a quick question: How would you implement deterministic features in this model. By this, I mean, we know the values of these features for the forecast period. Such as holidays that do not follow regular seasonalities (e.g. Eid) or some big events or some pre-planned promotions. In ARIMA, for instance, you can include these types of features as exogenous regressors in the model and you feed the model with the future values of these regressors.

I know this may be too vague, but I was wondering if something along the lines presented in this blog post was possible: https://www.angioi.com/time-series-encoder-decoder-tensorflow/

Thanks in advance.

dcdorukcengiz commented 3 years ago

I guess the main idea is to see NBEATS as "simply being a multivariate regression that is repeated many times and interleaved with non-linearities." (from Oreshkin et al. 2021). So, if we see NBEATS as an over-parameterized regression, it is straightforward to conclude that we can just append the exogenous deterministic features to the inputs. Because neural networks are not as robust as regressions to widely varying scales of its predictors, it might be a good idea to scale the latter features as well as the look back period separately. I wonder what others think.

philipperemy commented 2 years ago

@dcdorukcengiz sorry for the (very) late reply!

You can provide exogenous variables with N-Beats like that: https://github.com/philipperemy/n-beats/blob/master/examples/exo_example.py.

Note that in the original paper, they only consider 1-D time series without exogenous variables.

philipperemy commented 2 years ago

I'll close this issue for now. Feel free to comment if I haven't answered your question correctly! Thanks! :)