Model State Space Equations

Skip to first unread message

Matthew Gilbert

Jun 23, 2021, 3:52:05 PMJun 23
to pystatsmodels
I'm wondering if it is possible to get the state space equations associated with a model? For example when I create an ARIMA object it's unclear to me what parameters the .state_names refer to. e.g.

    > from statsmodels.tsa.arima.model import ARIMA
    > print(ARIMA(endog=[0], order=(2, 0, 0)).state_names)
    ['state.0', 'state.1']

    > print(ARIMA(endog=[0], order=(3, 0, 0)).state_names)
    ['state.0', 'state.1', 'state.2']

Looking at the documentation for SARIMAX and Section 3.4 of Koopman which is referenced, I believe I can make out the state for the ARIMA models above based on (3.19) when the models have d=D=0, i.e


which for the ARIMA(2,0,0) model above implies the state is given by


However I am unclear what the general form is when d != 0, and more generally curious if there is any helper methods in statsmodels to access the state space equations in an intuitive representation?

Thanks for any info!


Chad Fulton

Jun 23, 2021, 8:10:09 PMJun 23
to Statsmodels Mailing List
Hi Matt,

You're on the right track with the `state_names` attribute, but they simply haven't been implemented in a general way for SARIMAX yet (for example, the `UnobservedComponents` model has more helpful values `state_names`).

For SARIMAX, the lowest hanging fruit would be to do something better for the AR(p) case, since it is straightforward, but as your example shows, in even the ARMA(p, q) case it quickly becomes difficult to figure out what a useful "state name" would be.

So, unfortunately the answer is that we do not have any helper functions right now that would provide this information. But if you end up creating something and would be interested in adding it to Statsmodels (even if it just covered a subset of cases), that would be great!


You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Matthew Gilbert

Jun 24, 2021, 9:44:13 AMJun 24
Thanks Chad!

If I get some bandwidth and create something helpful for the models I am looking at I will definitely open a pull request.


Reply all
Reply to author
0 new messages