Automatic and manual ARIMA selection
Today's lesson is about a question every forecaster runs into the moment ARIMA() hands back an order: is this the model to trust, or is there a better one sitting one search away?
The running example is Beer, Australian quarterly beer production in megalitres, 218 quarters from 1956 Q1 through 2010 Q2, part of the aus_production data built into the tsibbledata package. Two ARIMA models get fitted to that exact same series in this lesson, and each one comes back with a different order and a different AICc, the score fable uses to compare them.
Here they are, side by side.
Same series, but the two searches came back with different answers, an AICc gap of almost two points between them. That gap is the first thread to pull on.
What ARIMA() decides on its own
Call ARIMA() on a series with no formula at all, no pdq(), no PDQ(), and it still hands back a complete order. It decides how many times to difference the series, and which of the four AR and MA integers, p, q, P and Q, actually go into the equation. Both of those decisions happen automatically, and it is worth knowing exactly how before you decide whether to trust what comes out.
Build the Beer series first.
Before it ever picks p, q, P or Q, ARIMA() runs two unit-root tests to decide d, the number of ordinary differences, and D, the number of seasonal differences. Both answer the same question: how many times does this series need to be differenced before its mean, variance and autocorrelation settle down instead of drifting or repeating a season? Run those same two tests directly with unitroot_ndiffs() and unitroot_nsdiffs(), the functions ARIMA() calls internally.
Both come back 1. One ordinary difference, d = 1, removes the upward drift in Beer production. One seasonal difference at lag 4, D = 1, removes the yearly pattern that repeats every four quarters.
With d and D already fixed, ARIMA() still has four more integers to choose: p and q, the non-seasonal AR and MA terms, and P and Q, their seasonal counterparts. It searches over combinations of those four, scores each candidate by AICc, a number that rewards a close fit and penalizes every extra parameter, and keeps whichever candidate scores lowest. Fit it and read the winner.
ARIMA(1,1,2)(0,1,1)[4] reads as: one non-seasonal AR term, one ordinary difference, two non-seasonal MA terms, then no seasonal AR term, one seasonal difference and one seasonal MA term, all at a period of 4 quarters. Its AICc, 1783.11, is the number that just got beaten in the table on the cover.