LAMPSPUC / StateSpaceModels.jl

StateSpaceModels.jl is a Julia package for time-series analysis using state-space models.
https://lampspuc.github.io/StateSpaceModels.jl/latest/
MIT License
272 stars 25 forks source link

add exogenous variables support for SARIMA and UnobservedComponents #258

Open guilhermebodin opened 3 years ago

detrin commented 1 year ago

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?

guilhermebodin commented 1 year ago

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 1 year ago

@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.

guilhermebodin commented 1 year ago

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 1 year ago

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