I fit data with auto.arima
function in variant with exog.
If I'm right, when exog is used, linear regression is used to fit data and residuals are fitted with arima, so coeffs of linear part must be always the same, but:
Var 1:
model = auto.arima(y,stationary=TRUE,stepwise=FALSE,parallel=TRUE,
num.cores=cn,approximation=FALSE,xreg=train_x,x=y)
Output 1:
13
Series: y
Regression with ARIMA(3,0,0) errors
Coefficients:
ar1 ar2 ar3 T R
0.7887 0.5917 -0.8989 -0.0076 4e-04
s.e. 0.0507 0.0836 0.0506 0.0035 2e-04
Var 2:
model = auto.arima(y,stepwise=FALSE,parallel=TRUE,num.cores=cn,
approximation=FALSE,xreg=train_x,x=y)
Output 2:
13
Series: y
Regression with ARIMA(0,0,0)(2,1,0)[12] errors
Coefficients:
sar1 sar2 T R
1.2310 -0.3639 0 0
s.e. 0.1379 0.1565 NaN NaN
lm
, take the residuals and model them withauto.arima
. That will fix the regression estimation in the first stage. $\endgroup$