import statsmodels.tsa.api as smtsa
aic=[]
for ari in range(1, 3):
obj_arima = smtsa.ARIMA(ts_log_diff, order=(ari,2,0)).fit(maxlag=30, method='mle', trend='nc')
aic.append([ari,2,0, obj_arima.aic])
print(aic)
[[1, 2, 0, -76.46506473849644], [2, 2, 0, -116.1112196485397]]
Therefore, our model parameters are p=2, d=2, and q=0 in this scenario for the AR model, as the AIC for this combination is the least.