Model State Space Equations

48 views
Skip to first unread message

Matthew Gilbert

unread,
Jun 23, 2021, 3:52:05 PM6/23/21
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

Selection_413.png

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

Selection_414.png

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!

-Matt

Chad Fulton

unread,
Jun 23, 2021, 8:10:09 PM6/23/21
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!

Best,
Chad

--
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 pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/05bc858b-947e-4f1f-b48e-dd3d0be893d6n%40googlegroups.com.

Matthew Gilbert

unread,
Jun 24, 2021, 9:44:13 AM6/24/21
to pystat...@googlegroups.com
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.

Best,
Matt

Victor Saucedo

unread,
Jul 17, 2023, 4:47:11 PM7/17/23
to pystatsmodels

Hello,

Just starting to use this code. I need an ARIMA (multivariate) in state space. I have a hard time to use the available examples for reasons presented below. Anyone has any new examples/code to share?

Thanks,

Victor
Reply all
Reply to author
Forward
0 new messages