0

I've created an ARIMA model, but I am unable to find a way to print the AIC or BIC results. I need these numbers for model comparison. Unfortunately the documentation on sourceforge is down, and I cannot find my answer when looking at the statsmodel github repository.

Here's my code:

import pandas as pd
import pandas.io.data
import statsmodels.formula.api as sm 
import matplotlib.pyplot as plt 
from statsmodels.tsa.arima_model import ARIMA

list = ['spy']
df = pd.io.data.get_data_yahoo(list, start = '2013-11-01', end = '2016-7-01', interval = 'm')['Adj Close'] 
df.dropna(inplace = True) 
df = df.pct_change()
df.dropna(inplace = True) 

model = ARIMA(df.spy, order = (0,0,1))
results_ARIMA = model.fit(disp=-1)
plt.plot(results_ARIMA.fittedvalues, color='red') 
plt.show() 
merv
  • 67,214
  • 13
  • 180
  • 245
Evy555
  • 215
  • 2
  • 9
  • 19

2 Answers2

1

I figured out the solution here. You need to import the ARMAResults class from statsmodels.tsa.arima_model.

from statsmodels.tsa.arima_model import ARMAResults 

Once this is complete you can insert

print(ARMAResults.summary(results_ARIMA))

This will print out the results summary which includes the BIC and AIC.

Evy555
  • 215
  • 2
  • 9
  • 19
  • 1
    If you just want the AIC or BIC values you can call the methods .aic() or .bic(). This will print out just the value. – Evy555 Jul 13 '16 at 17:23
0

results_ARIMA.aic and results_ARIMA.bic will give you the corresponding values. You don't need the brackets since these are not callable.