ARIMA model

Even for the ARIMA model, we can optimize the parameters by using the following code:

import statsmodels.tsa.api as smtsa
aic=[]
for ari in range(1, 3):
for maj in range(1,3):
arima_obj = smtsa.ARIMA(ts_log, order=(ari,1,maj)).fit(maxlag=30, method='mle', trend='nc')
aic.append([ari,1, maj, arima_obj.aic])
print(aic)

The following is the output you get by executing the preceding code:

[[1, 1, 1, -242.6262079840165], [1, 1, 2, -248.8648292320533], [2, 1, 1, -251.46351037666676], [2, 1, 2, -279.96951163008583]]

The combination with the least Akaike information criterion (AIC) should be chosen.