1
$\begingroup$

I am implementing an ARIMA model on a time series data. I have confirmed that the data is stationary with the adfuller test. I plotted my ACF and PACF graph as below with a lag of 40.

enter image description here

Here, I see the PACF plot for AR order and the p value looks like 8. I see the ACF graph for the order of the MA model and the q value looks like 5. Since there is no differencing, the d value is 0. so with p=8, d=0 and q=5, I fit and predict the model but the prediction flattens out after a while.

enter image description here

I use the grid search method to find the minimal AIC score and find that the orders should be 3, 0, 5 for p, d and q respectively. I fit this model and predicted the results as below and it seems to be a really good fit. Orange line is for the previous model and the green line is for the newer order.

enter image description here

My question is, have I interpreted the PACF and ACF plots incorrectly? Because, number of lollipops out of the confidence boundary are as mentioned above but still the data does not fit correctly. If not, why does the prediction flatten out after fitting well for a small subset of the data?

$\endgroup$
2
  • 2
    $\begingroup$ Your ACF and PACF plots confirm the data are not stationary: they are seasonal. (Evidently these are monthly data exhibiting an annual cycle). Use a seasonal model. The time series plots themselves exhibit a long-term trend. Use a first difference or explicitly model the trend. $\endgroup$
    – whuber
    Commented Aug 9, 2023 at 19:13
  • $\begingroup$ @whuber But doesnt the adfuller test resulting in a p-value of less than 0.05 signify that the data is stationary? $\endgroup$ Commented Aug 10, 2023 at 1:00

1 Answer 1

2
$\begingroup$

The Dickey-Fuller test tests for a specific kind of nonstationarity. At least in the version implemented in the R tseries package, it fits a regression on a linear trend, then models the residuals as AR(k) and tests whether the first autoregressive parameter is greater than one in absolute value. This can detect seasonality, but it is not intended to do so. There are seasonal unit root tests that are more appropriate to do so, since - as whuber points out - your ACF quite obviously shows a seasonality with cycle length 12.

I suspect you have monthly data. Given that your variable seems to be AverageTemperature, yearly seasonality should be very much expected.

An ARIMA(8,0,5) model looks very much like overfitting. There is a reason why standard auto-ARIMA algorithms constrain orders to be smaller. ARIMA(3,0,5) is not much better.

In your bottom plot, I am quite certain the green line is not the forecast from an ARIMA(3,0,5) model, because that one will also decay to a flat line very quickly and look essentially the same as the orange line. Your green lines come either from an in-sample fit, or they might conceivably be the forecasts from a seasonal ARIMA model (but then they would again look much more regular, so my money is on an in-sample fit).

That a non-seasonal ARIMA model with $d=0$ flattens out is the way things should be mathematically. We have many questions on this "phenomenon", take a look at this search, or variants like this one. That your in-sample fit looks better is just overfitting (see above), and a nice illustration of the fact that in-sample fit is not a good guide to out-of-sample accuracy, or the capability of a model to detect any true underlying model.

The Box-Jenkins approach to fit ARIMA models is very hard to use, and more importantly, you can't fit an ARMA(p,q) model based on ACF and PACF plots alone if both p and q are nonzero. It makes much more sense to use a tested and validated auto-ARIMA tool that automatically tests for potential seasonality (of course you need to tell it your potential seasonal cycles have a length of 12), integration and so forth: Selecting ARIMA orders by ACF/PACF vs. by information criteria

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.