# What's the 'right' number of parameters for an ARIMA model?

I'm working on an unassessed course problem,

The file Pas-mile.txt contains the monthly numbers of passenger miles travelled on US airlines for each month between January 1960 and December 1977. Find an ARIMA model for the series, carrying out appropriate diagnostic checks.

I've put the data at the bottom of this post. Here's a plot of the time series.

I differenced the data seasonally and non-seasonally. I think I can pose my question using only one of these, say the seasonal one.

y <- ts(data)
x <- diff(y,lag=12,differences=1)


I visually inspected the acfs and pacfs as suggested by my course notes,

acf(x, lag.max=216)
acf(x, type='partial', lag.max=216)


and I also did a grid-search:

aic.df <- data.frame()
for (i in 1:12){
for (j in 1:12){
aic.df[i,j] <- AIC(arima(x, order=c(i-1,0,j-1)))
}
}
aic.df


The lowest AIC (I think) is 324.5148, for $$\text{ARIMA}(10,1,8)_{12}$$. I tried searching a larger grid but stopped because the computation was taking too long. I also got quite a lot of messages like

Warning: possible convergence problem: optim gave code = 1 and Warning: NaNs produced.

This seems like quite a lot of parameters, and the non-seasonal differencing adds more. Writing the model out as $$y_t=\dots$$ would be quite cumbersome. If I had more computing power, perhaps I could have found a still better model with still more parameters. As I understand it, there's no risk of overfitting since the AIC takes parameter number into account. So what's the 'right' number of parameters?

Data

 2.42  2.14  2.28  2.50  2.44  2.72  2.71  2.74  2.55  2.49  2.13  2.28
2.35  1.82  2.40  2.46  2.38  2.83  2.68  2.81  2.54  2.54  2.37  2.54
2.62  2.34  2.68  2.75  2.66  2.96  2.66  2.93  2.70  2.65  2.46  2.59
2.75  2.45  2.85  2.99  2.89  3.43  3.25  3.59  3.12  3.16  2.86  3.22
3.24  2.95  3.32  3.29  3.32  3.91  3.80  4.02  3.53  3.61  3.22  3.67
3.75  3.25  3.70  3.98  3.88  4.47  4.60  4.90  4.20  4.20  3.80  4.50
4.40  4.00  4.70  5.10  4.90  5.70  3.90  4.20  5.10  5.00  4.70  5.50
5.30  4.60  5.90  5.50  5.40  6.70  6.80  7.40  6.00  5.80  5.50  6.40
6.20  5.70  6.40  6.70  6.30  7.80  7.60  8.60  6.60  6.50  6.00  7.60
7.00  6.00  7.10  7.40  7.20  8.40  8.50  9.40  7.10  7.00  6.60  8.00
10.45  8.81 10.61  9.97 10.69 12.40 13.38 14.31 10.90  9.98  9.20 10.94
10.53  9.06 10.17 11.17 10.84 12.09 13.66 14.06 11.14 11.10 10.00 11.98
11.74 10.27 12.05 12.27 12.03 13.95 15.10 15.65 12.47 12.29 11.52 13.08
12.50 11.05 12.94 13.24 13.16 14.95 16.00 16.98 13.15 12.88 11.99 13.13
12.99 11.69 13.78 13.70 13.57 15.12 15.55 16.73 12.68 12.65 11.18 13.27
12.64 11.01 13.30 12.19 12.91 14.90 16.10 17.30 12.90 13.36 12.26 13.93
13.94 12.75 14.19 14.67 14.66 16.21 17.72 18.15 14.19 14.33 12.99 15.19
15.09 12.94 15.46 15.39 15.34 17.02 18.85 19.49 15.61 16.16 14.84 17.04


AIC does guard against overfitting, but it will not completely prevent it. No metric can do that. So it is still important to sanity check one's model.

I find AR or MA orders of 8 or 10 on seasonally differenced data rather questionable. I could not really imagine a data generating process that really looked back 10 years, rather than just 5. There are good reasons why automatic ARIMA modeling procedures do not consider orders above 5.

Also, you are only modeling the seasonal part: your model is ARIMA(0,0,0)(10,1,8)[12]. The seasonal part is extremely complex per above, but the nonseasonal part is a flat line. That looks strange. You may want to follow the seasonal ARIMA modeling workflow illustrated here or here to see how one can set both seasonal and non-seasonal orders.

I personally am not a big fan of interpreting ACF/PACF plots and differencing back and forth to decide on ARIMA models. On the one hand, it's extremely hard, requires a lot of statistical understanding and is likely not replicable between analysts (if you have classmates, ask them what model they got - I would be surprised if half the class agreed). And you can't do it if you have more than one or a handful of time series. The newer order selection process based on information criteria makes more sense to me. (However, your teacher likely won't accept "I threw the time series into auto.arima(), and this is what came out" as a solution.)

• Stephen Kolassa and @Richard Hardy: thanks both for your answers. I find them both useful and have accepted the one that came first chronologically to close the question.
– mjc
Commented Mar 13, 2023 at 19:09

I differenced the data seasonally and non-seasonally.

and

This seems like quite a lot of parameters, and the non-seasonal differencing adds more

characterizes a typical mistake known as overdifferencing. You would normally difference your time series if has a unit root. Simple differencing is for a simple unit root, and a seasonal differencing is for a seasonal unit root. Eyeballing your series, I do not see any of the two.

But what happens if you difference a series that does not have a unit root? You introduce a unit-root moving-average component. With both simple and seasonal differencing, you may have introduced two of them. They produce certain autocorrelations that were not in the original series, and so you end up trying to fit these using high-order ARMA terms.

What I would do instead is think twice before differencing and see e.g. what auto.arima suggests in two cases: allowing for arbitrary orders of differencing and forcing the orders of differencing to zero.

• Can you say anything about how you visually identify unit roots?
– mjc
Commented Mar 13, 2023 at 12:49
• @mjc, you could generate some realizations of a random walk and plot them. E.g. run the following script a few times in R: plot(cumsum(rnorm(100)),type="l"). Meanwhile, your series looks like a smooth deterministic trend (not far away from linear, perhaps a slowly moving nonlinear one) coupled with heteroskedastic seasonality. Commented Mar 13, 2023 at 13:43