I am fitting a regression with ARMA errors using the base R function
arima() and the
Arima() function from the
The estimated coefficients from both are identical. My problem comes from using
arima.errors() on these two models, and using
tsdisplay() to view these structural residuals (that is, the residuals straight from the regression, before any ARMA model is fit on them). These ARMA errors (and their corresponding ACFs, PACFs) are different between the two, and I don't know why. Even more curious is that the final residuals from both are in fact the same, which would make me think the structural residuals would have to be the same. I have put a MWE below.
library('forecast') data(usconsumption, package='fpp') fit1 = arima(usconsumption[ ,1], xreg=usconsumption[ ,2], order=c(2,0,0)) tsdisplay(arima.errors(fit1), main="ARIMA errors, arima function") # not the same as the other fit2 = Arima(usconsumption[,1], xreg=usconsumption[,2], order=c(2,0,0)) dev.new() tsdisplay(arima.errors(fit2), main="ARIMA errors, Arima function") # not the same as the other View(cbind(resid(fit1), resid(fit2))) # final residuals are the same
Note this example is from https://www.otexts.org/fpp/9/1