Fitting a non-seasonal ARIMA model and reading its coefficients
Today let's understand how to actually fit an ARIMA model in R with an explicit order, and read every number it hands back once it is fit.
The running example is WWWusage, a dataset that ships inside R itself: the number of users connected to an internet server, recorded once a minute, for 100 straight minutes (Durbin and Koopman, 2001). A hundred minutes is nowhere near long enough to carry any daily or weekly repeat, so this series has no season to worry about, only a trend.
Here is the raw series.
It climbs for a stretch, drops back, and climbs again, with no repeating shape anywhere in it and no sign of settling near one fixed level. Three plain integers, chosen carefully, are enough to turn a series like this into one fitted model.
The ARIMA(p, d, q) notation, read as a sentence
ARIMA stands for AutoRegressive Integrated Moving Average, and every model in the family is written with the same three integers, in the same fixed order: ARIMA(p, d, q).
Each of the three counts something different:
- p counts the autoregressive terms: how many of the series' own past values the model uses to explain today's value.
- d counts the number of times the series gets differenced before fitting, which is exactly what "integrated" refers to in the name.
- q counts the moving-average terms: how many past forecast errors the model uses.
So ARIMA(2, 1, 1) reads as a sentence: 2 autoregressive terms, differenced once, 1 moving-average term. However large the three numbers get, every ARIMA order reads exactly this same way.