# auto.arima with an input of another series

Two time series, which are related to each other.

I want to see if "order" helps in predicting sales, by running auto.arima with and without the input of order.

sales<- c(15,25,37,45,53,72,77,88,97,83,92,85,113,133,124,137,131,147)
order<- c(35,35,36,39,40,40,42,46,45,45,50,51,49,53,53,56,56,58)

sales_ts <- ts(sales, frequency = 1, start=c(1950))
order_ts <- ts(order, frequency = 1, start=c(1950))


auto.arima without the input.

auto.arima(sales_ts)

Series: sales_ts

ARIMA(0,1,0) with drift

Coefficients:
drift
7.7647
s.e.  2.6222

sigma^2 estimated as 124.2:  log likelihood=-64.59

AIC=133.18   AICc=134.04   BIC=134.85


auto.arima with the input of a series.

auto.arima(sales_ts, xreg = order_ts)

Series: sales_ts

Regression with ARIMA(0,0,0) errors

Coefficients:
intercept    xreg
-146.8293  5.0626
s.e.    16.4214  0.3521

sigma^2 estimated as 135.7:  log likelihood=-68.67

AIC=143.35   AICc=145.06   BIC=146.02


Judged from the AIC values (133.18 vs 143.35). Am I right that the input of the order series is not helpful in fitting the auto.arima for sales?

The ultimate goal is to predict sales. ARIMAX only provides model fitting but no forecast, so I want to see how auto.arima can help in forecasting when combined the 2 series.

Judging only by the AIC, you would be correct: smaller AICs are better, and a difference of 10 is quite strong. It appears as if the model without the external regressor is a better fit to the data, and will therefore probably perform better in forecasting.

However.

It's always a good idea to plot data.

plot(sales_ts)
lines(order_ts,col="red")
legend("topleft",lwd=1,col=1:2,legend=c("Sales","Orders"))


The correlation is not perfect, but there seems to be an obvious relationship between sales and orders. Enough that I suspect there may be more here than meets the eye.

I see two possibilities:

1. The AIC reported by auto.arima() may only account for the ARIMA model part, not the regression on orders that precedes the ARIMA modeling. I can't tell, and the documentation is not telling, either. You may want to dig through the source code.
2. Both sales and orders show an increasing trend. The question really is whether there is an "inherent" trend in sales (which can be captured by the drift term in your first model), or whether sales are mainly driven by the (trending) orders.

Unfortunately, there is no way to disentangle this with just the data you have. You would need to wait for a time with increasing orders and decreasing sales to have an indication that the two are independent...

To be honest, sales being driven by orders (possibly with a lag) seems to be obvious enough to me that I would try to use orders in forecasting sales. I would suggest that you find out how far ahead orders happen with respect to sales, to see how much you need to lag them. (And if you need to forecast further out, you will need to forecast the orders themselves.)

Then you can compare models using a holdout sample. This may be helpful.

• sir, thanks for the fantastic breakdown of the problem, and explanation. Wish you a good day! – Mark K Sep 26 '19 at 14:27