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

Viewed 778

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)

1 Answers
  • 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)

AutoReg estimates parameters using OLS which is conditional (on the first observation) maximum likelihood. ARIMA implements full maximum likelihood and so uses the available information in the first observation when estimating parameters. In very large samples, the coefficients should be very close, and they are equal in their asymptotic limit. IN practice, they will always differ, although the difference should usually be minor.

  • After getting the coefficients and backtesting the fitted results I match those of the AR(1) but not of ARIMA(1). Why?

The two models use different representations. AutoReg(1)'s model is Y(t) = a + b Y(t-1) + eps(t). ARIMA(1,0,0) is specified as (Y(t) - c) = b * (Y(t-1) - c) + eps(t). If |b|<1, then in the large sample limit c = a / (1-b), although in finite samples this identity will not hold exactly.

  • What is ARIMA really doing in this simplest setting, isnt it supposed to be able to reproduce AR?

No. ARIMA uses the statsmodels Statespace framework which can estimate a wide range of models using Gaussian MLE.

ARIMA is essentially a special case of SARIMAX and this notebook provides a good introduction.

Related