# Auto.arima coefficients with exogeneous variables

I have the following output from the auto.arima function with specified xreg:

Series: Individuals
Regression with ARIMA(2,1,1) errors

Coefficients:
ar1      ar2     ma1  inflation  GDP growth  EURIBOR
-0.8366  -0.3928  0.4008    -0.0013      -8e-04   0.0139
s.e.   0.2155   0.0863  0.2333     0.0023       1e-03   0.0036

sigma^2 estimated as 0.0004495:  log likelihood=453.32
AIC=-892.63   AICc=-892   BIC=-870.09


Does it hold that

$$y_t = -0.0013*inflation_t -8*10^{-4}*GDP_t + 0.0139*EURIBOR_t + n_t$$

$$n_t = -0.8366*n_{t-1} - 0.3928*n_{t-2} + e_t + 0.4008*e_{t-1}$$

or does the differencing change something?

I get the residuals by the following code

nt <- residuals(fitInd, type = "regression")
et <- residuals(fitInd, type = "innovation")


When I check with the residuals "nt" it does match, for example

nt[4]=0.2621466


and per the first equation:

$$y_4 - (-0.0013*inflation_4 -8*10^{-4}*GDP_4 + 0.0139*EURIBOR_4)= n_4 = 0.2621466$$

However, it does not match for the innovation errors "et" per the second equation which should be equal to nt[4]:

-0.8366*nt[3] - 0.3928*nt[2] + et[4] + 0.4008*et[3] = -0.3318558


Could someone clarify what I am doing wrong. Thanks in advance.

• Did you test for and possibly consider lags of any of the three predictors ? Were there any untreated anomalies in the residuals ? Was the error variance of the residuals constant over time ? These are items that need to be considered in determining a useful model. Oct 7, 2019 at 14:32

## 1 Answer

Your equation would have been right if you used $$\Delta n_t$$ instead of $$n_t$$. It's the differenced model, like ARMA of $$\Delta n_t$$:

$$\Delta n_t = -0.8366*\Delta n_{t-1} - 0.3928*\Delta n_{t-2} + e_t + 0.4008*e_{t-1}$$

• good eyes ! as usual Oct 7, 2019 at 14:34
• Thank you, this gives more reasonable results. Interestingly, the figures do not match exactly: nt[4]-nt[3] = -0.002577296 and coefs[1]*(nt[3]-nt[2])+coefs[2]*(nt[2]-nt[1]) + et[4] + coefs[3]*et[3] = -0.002600029 What could be the reason for this slight mis-match? Oct 8, 2019 at 6:50
• The difference could be in how you and R seed the initial values of errors given the ma and ar terms Oct 8, 2019 at 12:55