Scikit learn and statsmodels don't seem to support this type of ARMA. I tried to use rpy2 python library, but that proved to be far too difficult to integrate, as my IDE was not able to recognize my R_HOME directory.

Is there another way to do a SARIMA? I have all my data in pandas dataframes, by the way.


  • $\begingroup$ If you know how to write the model yourself, you can try Stan/Pystan. Basic ARMA/AR models are relatively easy to program. $\endgroup$ – Nate Oct 24 '14 at 12:05

There is a development branch of Statsmodels that allows SARIMA (optionally with exogenous regressors as well) via state-space models. It won't be integrated into the core until after Statsmodels 0.6 is released (the release should be this month, then the state-space branch integrated in the upcoming months).

In the meantime, if you would like to do this (and are willing to install / build a development branch of Statsmodels from source) then you can use the code found at: https://github.com/ChadFulton/statsmodels/tree/kalman

To do so, you will need to have Numpy, Scipy, Cython, Pandas and Statsmodels available on your system, download the source code from the Github repository, and then in the downloaded "statsmodels" folder, issue the command python setup.py install. This will overwrite your default statsmodels (so if you don't want that, you might consider making a virtualenv)

If you do manage to get it installed, here's an example notebook showing how to use the SARIMAX class: http://nbviewer.ipython.org/gist/ChadFulton/5127108f4c7025ed2648


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.