SARIMAX parameters

703 views
Skip to first unread message

rriveral

unread,
Jan 5, 2018, 7:36:07 AM1/5/18
to pystatsmodels
Hello, 


I have a small question regarding the parameter enforce_stationarity for the SARIMAX and VARMA model, how is this achieved? the first difference?  

Many thanks 




Chad Fulton

unread,
Jan 5, 2018, 8:48:00 AM1/5/18
to pystat...@googlegroups.com
We constrain the estimated parameters such that the roots of the  associated lag polynomial must be outside the unit circle.

For example, in the AR(1) case this means the autoregressive parameter is constrained to lie within (-1, 1).

rriveral

unread,
Jan 6, 2018, 11:35:23 AM1/6/18
to pystatsmodels
thank you,

I was also utilizing VARMA model 

I found the following comment, is this restriction still exist or is an old post

/private/tmp/statsmodels/statsmodels/tsa/statespace/varmax.py:153: EstimationWarning: Estimation of VARMA(p,q) models is not generically robust, due especially to identification issues.
  EstimationWarning)

source link

Chad Fulton

unread,
Jan 6, 2018, 12:29:47 PM1/6/18
to Statsmodels Mailing List
On Sat, Jan 6, 2018 at 11:35 AM, rriveral <rodolfo...@gmail.com> wrote:
thank you,

I was also utilizing VARMA model 

I found the following comment, is this restriction still exist or is an old post

/private/tmp/statsmodels/statsmodels/tsa/statespace/varmax.py:153: EstimationWarning: Estimation of VARMA(p,q) models is not generically robust, due especially to identification issues.
  EstimationWarning)

source link




Yes, this is still true. The parameters of a VARMA model are not identified, and we do not yet have any of the normalizations that would impose a unique VARMA representation that would identify the parameters.

rriveral

unread,
Jan 20, 2018, 8:03:15 PM1/20/18
to pystatsmodels

Hello Chad, 

Coming back to the function enforce stationarity,  would this be considered as a procedure to make the time series stationary, like first order difference? are this comparable results? 

Chad Fulton

unread,
Jan 20, 2018, 8:56:17 PM1/20/18
to Statsmodels Mailing List
On Sat, Jan 20, 2018 at 8:03 PM, rriveral <rrodolf...@gmail.com> wrote:

Hello Chad, 

Coming back to the function enforce stationarity,  would this be considered as a procedure to make the time series stationary, like first order difference? are this comparable results? 
 



No, it just limits the ARMA *representation* of the series. As an example, suppose you had a time series that was generated as a random walk, i.e. AR parameter equal to 1. By first-differencing, you would get a different time series, with AR parameter equal to 0.

On the other hand, if you tried to estimate the parameter of the original series using the SARIMAX function with order=(1, 0, 0) and enforce_stationarity=True, then (with a long enough sample), the estimator would make try to set the AR parameter to 1 but, since enforce_stationarity=True, it could not actually set the parameter equal to 1, so it would instead set an estimate like 0.999.

enforce_stationarity does not affect the time series that you put in, it only constrains the *estimates* of the coefficients.

Hope that helps,
Chad

rriveral

unread,
Jan 21, 2018, 9:27:31 AM1/21/18
to pystatsmodels
Thank you very much for your answers, I would like to ask a couple of more questions in order to get a clear understanding of the function. 
my comments in red


No, it just limits the ARMA *representation* of the series. As an example, suppose you had a time series that was generated as a random walk, i.e. AR parameter equal to 1. By first-differencing, you would get a different time series, with AR parameter equal to 0.


On the other hand, if you tried to estimate the parameter of the original series using the SARIMAX function with order=(1, 0, 0) and enforce_stationarity=True, then (with a long enough sample), the estimator would make try to set the AR parameter to 1 but, since enforce_stationarity=True, it could not actually set the parameter equal to 1, so it would instead set an estimate like 0.999.


enforce_stationarity does not affect the time series that you put in, it only constrains the *estimates* of the coefficients.
I understand, my previous question was more oriented to the results obtained from the ARMA model when the enforce stationarity is equal to True, for example, let's assume that I have a non-stationary time series, if I plug this time series into the model I get an error, with the condition, enforce stationary = True I am able to fit the model and make a forecast, on an Idealized scenario of stationarity limiting its polynomial roots within the unit circle, as you have mentioned. 

On the other hand, evaluating the time series differently, for example, I make the first difference on the time series to make it stationary then I fit the ARMA model I get the forecast and finally invert the time series from a difference estate to "non-differentiated" one. 

So my question was oriented more or less to the scenario described above, would this make sense? are this results comparable to a certain degree? Do you know if there's any literature that addresses this? 

josef...@gmail.com

unread,
Jan 21, 2018, 9:40:13 AM1/21/18
to pystatsmodels
On Sun, Jan 21, 2018 at 9:27 AM, rriveral <rrodolf...@gmail.com> wrote:
Thank you very much for your answers, I would like to ask a couple of more questions in order to get a clear understanding of the function. 
my comments in red


No, it just limits the ARMA *representation* of the series. As an example, suppose you had a time series that was generated as a random walk, i.e. AR parameter equal to 1. By first-differencing, you would get a different time series, with AR parameter equal to 0.


On the other hand, if you tried to estimate the parameter of the original series using the SARIMAX function with order=(1, 0, 0) and enforce_stationarity=True, then (with a long enough sample), the estimator would make try to set the AR parameter to 1 but, since enforce_stationarity=True, it could not actually set the parameter equal to 1, so it would instead set an estimate like 0.999.


enforce_stationarity does not affect the time series that you put in, it only constrains the *estimates* of the coefficients.
I understand, my previous question was more oriented to the results obtained from the ARMA model when the enforce stationarity is equal to True, for example, let's assume that I have a non-stationary time series, if I plug this time series into the model I get an error, with the condition, enforce stationary = True I am able to fit the model and make a forecast, on an Idealized scenario of stationarity limiting its polynomial roots within the unit circle, as you have mentioned. 

On the other hand, evaluating the time series differently, for example, I make the first difference on the time series to make it stationary then I fit the ARMA model I get the forecast and finally invert the time series from a difference estate to "non-differentiated" one. 

This is what the "I" in ARIMA/SARIMAX is for, i.e. ARIMA(1,1,1)  or SARIMAX(1, 1, 0) differences the series once. predict has an option to return prediction for the differenced or integrated level. In general order = (p, d, q) where d is how often the series is differenced.

References to search for are for ARIMA or unit roots. (The multivariate extension would be under the topic of "cointegration" available in VECM)

Josef

rriveral

unread,
Jan 21, 2018, 12:48:28 PM1/21/18
to pystatsmodels
Perfect! 

That was exactly what I was looking, since I was not abel to find that functionality on the VAR model. I was un aware of the VECM . 

I have found a note explaining with an example 


however, when I try to import the library I get this error 

%matplotlib inline
import pandas
from statsmodels.tsa.vecm.vecm import VECM, select_order
import data as dta
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-525-118971034ac4> in <module>()
      1 get_ipython().magic('matplotlib inline')
      2 import pandas
----> 3 from statsmodels.tsa.vecm.vecm import VECM, select_order
      4 import data as dta

ModuleNotFoundError: No module named 'statsmodels.tsa.vecm'

many thanks! 

josef...@gmail.com

unread,
Jan 21, 2018, 12:52:28 PM1/21/18
to pystatsmodels
On Sun, Jan 21, 2018 at 12:48 PM, rriveral <rrodolf...@gmail.com> wrote:
Perfect! 

That was exactly what I was looking, since I was not abel to find that functionality on the VAR model. I was un aware of the VECM . 

I have found a note explaining with an example 


however, when I try to import the library I get this error 

VECM was merged after 0.8 and is currently only available in statsmodels master.

Josef
Reply all
Reply to author
Forward
Message has been deleted
0 new messages