Let the time series be denoted by . First, we will define an ARMA model with no covariates:
ARMAX modelsAn ARMAX model simply adds in the covariate on the right hand side:
If we write the model using backshift operators, the ARMAX model is given by
Regression with ARMA errorsFor this reason, I prefer to use regression models with ARMA errors, defined as follows.
Using backshift operators, this model can be written as
Transfer function modelsBoth of these models can be considered as special cases of transfer function models, popularized by Box and Jenkins:
Sometimes these are called “dynamic regression models”, although different books use that term for different models.
The method for selecting the orders of a transfer function model that is described in Box and Jenkins is cumbersome and difficult, but continues to be described in textbooks. A much better procedure is given in Pankratz (1991), and repeated in my 1998 forecasting textbook.
Non-stationary dataFor ARIMA errors, we simply replace with where denotes the differencing operator. Notice that this is equivalent to differencing both and before fitting the model with ARMA errors. In fact, it is necessary to difference all variables first as estimation of a model with non-stationary errors is not consistent and can lead to “spurious regression”.
arima()function in R (and
auto.arima()from the forecast package) fits a regression with ARIMA errors. Note that R reverses the signs of the moving average coefficients compared to the standard parameterization given above.
arimax()function from the TSA package fits the transfer function model (but not the ARIMAX model). This is a new package and I have not yet used it, but it is nice to finally be able to fit transfer function models in R. Sometime I plan to write a function to allow automated order selection for transfer functions as I have done with
auto.arima()for regression with ARMA errors (part of the forecast package)