Why statsmodels' ARIMA(1,0,0) is not equivalent to AutoReg(1)?

120 views
Skip to first unread message

Konstantin Vasilev

unread,
Aug 12, 2020, 3:44:48 PM8/12/20
to pystatsmodels
I am comparing the results from arima_model and ar_model. Here is what I can't understand:

 - Why are the resulting coefficients different? Is it because of the estimation method? (Different settings of the method property of fit() don't give identical results)
 - After getting the coefficients and backtesting the fitted results I match those of the AR(1) but not of ARIMA(1). Why?
 - What is ARIMA really doing in this simplest setting, isnt it supposed to be able to reproduce AR?

```
    import pandas_datareader as pdr
    import datetime 
    aapl = pdr.get_data_yahoo('AAPL', start=datetime.datetime(2006,1,1), end=datetime.datetime(2020,6,30))
    
    aapl = aapl.resample('M').mean()
    aapl['close_pct_change'] = aapl['Close'].pct_change()
    
    from statsmodels.tsa.arima_model import ARIMA
    mod = ARIMA(aapl['close_pct_change'][1:], order=(1,0,0))
    res1 = mod.fit(method='mle')
    print(res1.summary())
    
    from statsmodels.tsa.ar_model import AutoReg, ar_select_order
    mod = AutoReg(aapl['close_pct_change'][1:], 1)
    res2 = mod.fit()
    print(res2.summary())
    
    fitted_check1 = res1.params[0] + res1.params[1]*aapl['close_pct_change'][1:].shift(1)
    print(fitted_check1[1:] - res1.fittedvalues)
    
    fitted_check2 = res2.params[0] + res2.params[1]*aapl['close_pct_change'][1:].shift(1)
    print(fitted_check2[1:] - res2.fittedvalues)

```
Message has been deleted

Kevin Sheppard

unread,
Aug 12, 2020, 8:16:12 PM8/12/20
to pystatsmodels
Autoreg estimated parameters by OLS. ARIMA estimates parameters using maximum likelihood. In large samples these are asymptotically equivalent, but they differ for finite samples sizes.

Pedro Albuquerque

unread,
Aug 12, 2020, 8:19:57 PM8/12/20
to pystat...@googlegroups.com
This is an interesting question...
The point estimate should be the same in both OLS and ML and the asymptotic equivalence should be with respect to the standard error.
Unless there is some finite sample correction in the statsmodels implementation. Do I miss something?


On Wed, Aug 12, 2020 at 8:16 PM Kevin Sheppard <kevin.k....@gmail.com> wrote:
Autoreg estimated parameters by OLS. ARIMA estimates parameters using maximum likelihood. In large samples these are asymptotically equivalent, but they differ for finite samples sizes.

--
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/1daca3a7-2099-4398-aa75-7435248e82d8o%40googlegroups.com.

Kevin Sheppard

unread,
Aug 12, 2020, 8:27:44 PM8/12/20
to pystatsmodels
The OLS estimate discards the first point. MLE does not, and so the optimization problems are not equivalent. 

You received this message because you are subscribed to a topic in the Google Groups "pystatsmodels" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pystatsmodels/qzeaZlyiO_o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/CAAQo5ozomnHNUctd%2BAS4UEv%2B_btdnU6G%2B2%3DSDxuJYio_2eEQZQ%40mail.gmail.com.

Kevin Sheppard

unread,
Aug 12, 2020, 8:29:37 PM8/12/20
to pystatsmodels
FWIW and two point estimators that always produce the same estimate must also have the same limiting distribution.

Pedro Albuquerque

unread,
Aug 12, 2020, 8:47:21 PM8/12/20
to pystat...@googlegroups.com
Thanks, Kevin.

On Wed, Aug 12, 2020 at 8:29 PM Kevin Sheppard <kevin.k....@gmail.com> wrote:
FWIW and two point estimators that always produce the same estimate must also have the same limiting distribution.

--
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.

Konstantin Vasilev

unread,
Aug 13, 2020, 1:33:07 AM8/13/20
to pystatsmodels
Thank you. What about recreating the fitted values with the coefficients, what am I missing there?

Kevin Sheppard

unread,
Aug 13, 2020, 2:49:27 AM8/13/20
to pystatsmodels
ARIMA and other statespace models are parameterized as

(Y_t - mu) = phi * (Y_t-1 - mu) + eps_t

while AutoReg is parameterized as

Y_t = psi + phi Y_t-1 + eps_t

so you need to account for the different parameterization.
Reply all
Reply to author
Forward
0 new messages