LAMPSPUC/StateSpaceModels.jl

add exogenous variables support for SARIMA and UnobservedComponents

Opened this issue · 5 comments

add exogenous variables support for SARIMA and UnobservedComponents
detrin commented

Hello,

would you be open on adding X into SARIMA model to get also SARIMAX? The only option as of now is statsmodels in python. I don't count using R as an option. https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.sarimax.SARIMAX.html
Which is alright, but it is terribly slow, because the whole implementation is just in python. I was thinking about writing SARIMAX from scratch in rust language, but that would be indeed nontrivial amount of work. I found your package and it looks very well, except missing the input for exogenous variables.

image
Source: https://towardsdatascience.com/time-series-forecasting-with-arima-sarima-and-sarimax-ee61099e78f6

Would you be open to this feature?

Hi @detrin we would be totally open to this feature. Would you be willing to make a PR in the SARIMA model to extend it to be a SARIMAX?

There are two ways of doing it: one is to add state variables that represent the betas and another is to make a linear regression and then try to estimate the SARIMAX on the noises. Ideally, we could use R and Python as benchmarks to develop some tests for smaller models

detrin commented

@guilhermebodin thanks for the response

I could make a PR, however it will take me a while to understand the codebase, I might have some questions.

one is to add state variables that represent the betas

This seems to me as better especially if the exogenous variables would be weakly coupled to the target variable and the time series are rather short (40-100 time points).

Benchmarking against python pkgs or R pkgs is great idea.

I would be happy to guide you if you are available, one option to speed things up is to talk to me via the Julia slack https://julialang.org/slack/

detrin commented

As soon as I have some time to spare I will get into reading your codebase. Thanks