Discussion:
[pystatsmodels] Reference of ARIMA in python
z***@gmail.com
2018-09-12 22:39:12 UTC
Permalink
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop an
ARIMA model. Recently I am writing the methodology of ARIMA, but I can not
find any reference on the
page:https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html

So here my question is where could I find the reference (or formula) used
"statsmodels.tsa.arima_model import ARIMA" in Python?

Thank you in advance.
Chad Fulton
2018-09-13 00:54:18 UTC
Permalink
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop an
ARIMA model. Recently I am writing the methodology of ARIMA, but I can not
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula) used
"statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space form
and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.

You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.

Chad
qianqian zhang
2018-09-17 15:40:47 UTC
Permalink
Hi Chad,

Thank you for your reply.
I checked the references you mentioned above, I am still not sure about the
ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for example,Y
t = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q, where µ is
a constant, http://www.stanfordphd.com/ARIMA_Process.html ) but some donot
have.
Do you have some suggestions?
Thanks!

Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop an
ARIMA model. Recently I am writing the methodology of ARIMA, but I can not
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula) used
"statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
Chad Fulton
2018-09-17 23:23:49 UTC
Permalink
Post by qianqian zhang
Hi Chad,
Thank you for your reply.
I checked the references you mentioned above, I am still not sure about
the ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for example,
Yt = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q, where µ is
a constant, http://www.stanfordphd.com/ARIMA_Process.html ) but some
donot have.
Do you have some suggestions?
Thanks!
Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop
an ARIMA model. Recently I am writing the methodology of ARIMA, but I can
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula)
used "statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
If you are looking for the description of the ARIMA model itself, it is
provided at the link from your first e-mail:
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html

and it is:

\phi(L) (y_t - X_t \beta) = \theta(L) \espilon_t

where \phi(L) and \theta(L) are the autoregressive and moving average lag
polynomials.

So for example, if you specify `mod = sm.tsa.ARIMA(endog, order=(1, 0, 1)`
and you include a constant term (which is the default), then your model is:

(y_t - \mu) = \phi_1 (y_{t-1} - \mu) + \varepsilon_t + \theta_1
\varepsilon_t

Best,
Chad
Post by qianqian zhang
Hi Chad,
Thank you for your reply.
I checked the references you mentioned above, I am still not sure about
the ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for example,
Yt = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q, where µ is
a constant, http://www.stanfordphd.com/ARIMA_Process.html ) but some
donot have.
Do you have some suggestions?
Thanks!
Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop
an ARIMA model. Recently I am writing the methodology of ARIMA, but I can
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula)
used "statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
qianqian zhang
2018-09-17 23:56:58 UTC
Permalink
Hi Chad,

Thanks for your suggestions.
Actually, I saw the equation before, but I don't understand what "Xtβ"
represent
in the equation: Ί(L)(Yt−Xtβ)=Θ(L)Εt. Based on your example, does "Xtβ"
mean the mean value µ?
Thanks.

Best Regards,
Qian
Post by Chad Fulton
Post by qianqian zhang
Hi Chad,
Thank you for your reply.
I checked the references you mentioned above, I am still not sure about
the ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for
example,Yt = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q,
where µ is a constant, http://www.stanfordphd.com/ARIMA_Process.html )
but some donot have.
Do you have some suggestions?
Thanks!
Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop
an ARIMA model. Recently I am writing the methodology of ARIMA, but I can
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula)
used "statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
If you are looking for the description of the ARIMA model itself, it is
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
\phi(L) (y_t - X_t \beta) = \theta(L) \espilon_t
where \phi(L) and \theta(L) are the autoregressive and moving average lag
polynomials.
So for example, if you specify `mod = sm.tsa.ARIMA(endog, order=(1, 0, 1)`
(y_t - \mu) = \phi_1 (y_{t-1} - \mu) + \varepsilon_t + \theta_1
\varepsilon_t
Best,
Chad
Post by qianqian zhang
Hi Chad,
Thank you for your reply.
I checked the references you mentioned above, I am still not sure about
the ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for
example,Yt = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q,
where µ is a constant, http://www.stanfordphd.com/ARIMA_Process.html )
but some donot have.
Do you have some suggestions?
Thanks!
Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop
an ARIMA model. Recently I am writing the methodology of ARIMA, but I can
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula)
used "statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
Chad Fulton
2018-09-18 01:07:52 UTC
Permalink
Post by qianqian zhang
Hi Chad,
Thanks for your suggestions.
Actually, I saw the equation before, but I don't understand what "Xtβ" represent
in the equation: Ί(L)(Yt−Xtβ)=Θ(L)Εt. Based on your example, does "Xtβ"
mean the mean value µ?
Thanks.
Best Regards,
Qian
Xtβ is just like a typical linear regression, except that here it
represents the mean of the ARIMA process. If that regression only has a
constant term, then that's just like an ARIMA model with the mean value µ. If
the regression has additional regressors, then the mean will depend on
those values and so will be different at different time periods.

Chad
qianqian zhang
2018-09-18 15:31:21 UTC
Permalink
Hi Chad,

Thank you so much for your help!

Best Regards,
Qian
Post by Chad Fulton
Post by qianqian zhang
Hi Chad,
Thanks for your suggestions.
Actually, I saw the equation before, but I don't understand what "Xtβ" represent
in the equation: Ί(L)(Yt−Xtβ)=Θ(L)Εt. Based on your example, does "Xtβ"
mean the mean value µ?
Thanks.
Best Regards,
Qian
Xtβ is just like a typical linear regression, except that here it
represents the mean of the ARIMA process. If that regression only has a
constant term, then that's just like an ARIMA model with the mean value
µ. If the regression has additional regressors, then the mean will depend
on those values and so will be different at different time periods.
Chad
j***@gmail.com
2018-09-17 23:24:37 UTC
Permalink
Post by qianqian zhang
Hi Chad,
Thank you for your reply.
I checked the references you mentioned above, I am still not sure about
the ARIMA formula behind the codes ("statsmodels.tsa.arima_model import
ARIMA'').
I found some references showed the formula contain a constant (for example,
Yt = µ + φ1 Yt-1 + ... + φp Yt-p + εt + ψ1 εt-1 + ... + ψq εt-q, where µ is
a constant, http://www.stanfordphd.com/ARIMA_Process.html ) but some
donot have.
Do you have some suggestions?
specific to this
For constant, trend and exogenous variables, statsmodels implements the
version with ARIMA in regression error.

see for example https://otexts.org/fpp2/dynamic.html
Hyndman has a blog article about the two versions for including constant
and regressors, but I don't find it right now.

essentially the mean and regressor part is taken out first, and the
difference/residual is taken to be a ARIMA process
if y is observed endog, X are some exog
z = y - const - trend - X b
z ~ ARIMA with mean zero



Josef
Post by qianqian zhang
Thanks!
Best Regards,
Qian
Post by Chad Fulton
Post by z***@gmail.com
I used "statsmodels.tsa.arima_model import ARIMA" in Python to develop
an ARIMA model. Recently I am writing the methodology of ARIMA, but I can
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
So here my question is where could I find the reference (or formula)
used "statsmodels.tsa.arima_model import ARIMA" in Python?
Thank you in advance.
For sm.tsa.ARIMA estimated via MLE, the model is cast into state space
form and the log-likelihood is evaluated using the prediction error
decomposition computed using the Kalman filter.
You can consult Hamilton (1994) "Time series analysis" or Durbin and
Koopman (2012) "Time series analysis by state space methods" for details.
Chad
Loading...