1

I have written a code in python to generate a sequence of ARIMA model's and determine their AIC values to compare them.The code is as below,

p=0
q=0
d=0

for p in range(5):
    for d in range(1):
        for q in range(4):
            arima_mod=sm.tsa.ARIMA(df,(p,d,q)).fit()
            print(arima_mod.params)
            print arima_mod.aic()

I am getting a error message as below,

TypeError                                 Traceback (most recent call last)
<ipython-input-60-b662b0c42796> in <module>()
      8             arima_mod=sm.tsa.ARIMA(df,(p,d,q)).fit()
      9             print(arima_mod.params)
---> 10             print arima_mod.aic()
        global arima_mod.aic = 1262.2449736558815
     11 

**TypeError: 'numpy.float64' object is not callable**

1 Answer 1

4

Remove the brackets after print arima_mod.aic(). As I read it, arima_mod.aic is 1262.2449736558815, and thus a float. The brackets make python think it is a function, and tries to call it. You do not want that (because it breaks), you just want that value. So remove the brackets, and you'll be fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.