# Fitting an ARIMA to CPI: How "valid" is this model I've fitted?

I'm trying to fit an ARIMA model to monthly CPI. SO far, I've established stationarity using a DF test of the differenced CPI.

I have then proceeded to find the ACF and PACF of the differenced variable, which are as follows:

These are very peculiar to me (i.e. 3 irregular and significant lags after the first for both ACF and PACF). What can I make of this? Is this due to seasonality?

Regardless, I proceeded to fit the best ARIMA model using the auto.arima feature in R which picks an ARIMA model with the lowest information criterion. What I got was an ARIMA(2,1,2) as follows:

All coefficients are signficant, and the BIC would be lowest here, so I don't see any problems. Please correct me if I'm wrong in saying that there is nothing wrong here

I then proceeded to do some residual diagnostics, namely, doing a Box-Ljung test of the residuals with the following lags/dfs (not totally sure what this does) but anyways here are the results (and also the code I used):

So for df=1,4 and 5 (arbitrarily chosen, is there a better way to do this?) I get p > 0.05 which is what I am looking for. But for df= 36, 12 and 13 I get p <0.05 which is indicating that there are correlations among residuals indicating that the ARIMA(2,1,2) is not a good model.

Finally, I've included an ACF of the residuals:

Again, this is not what I'd like to see as we see a few significant correlations here.

So, should I accept this model regardless of the fact that there were a few indications that it wasn't ideal (ACF, PACF, Box-Ljung test, and ACF of residuals)? What would you do next? Does the ACF or PACF indicate seasonality perhaps?

Any help or guidance is appreciated! I'm still new to ARIMA modelling.

• A 12-month seasonality in the monthly changes in CPI could some mixture of (a) regular seasonal price rises and falls, e.g. before and after the holiday season or (b) regular excise duty and indirect tax changes associated with an annual government budget Jun 9 at 17:12

You have some seasonality going on at period/frequency 12, and I don't know if auto.arima is taking that into account. You haven't posted your code.
Instead of using black box functions and not being totally certain about how they work, I would suggest writing down a few low-order SARIMA models, deriving their ACF and PACFs, and then try picking a model based on how its theoretical ACF/PACF fits your empirical ACF/PACF. If you need to check your work, R has a function ARMAacf that can help you.
• +1. auto.arima() in this case does not take the seasonality into account - ARIMA(2,1,2) is non-seasonal. I strongly suspect d.Y does not have a seasonality attribute, which needs to be encoded explicitly via ts(..., frequency=12). Plus, I personally do not recommend differencing the time series outside auto.arima(), which should be able to decide on the order of differencing by itself. It probably does a better job at model selection via information criteria than someone untrained (sorry) by looking at (P)ACF in the box-jenkins way. Mar 21 '18 at 4:17