I am fitting both an arima model (with xreg variables) and a gls model to my data in R software. They both have the same ARMA structure and variables. The ARIMA model fits to the data better. Does anyone know what the difference between these two are? I have seen that the equation for an ARIMA model in R with xreg is a linear regression with ARMA errors. Is that the same as a linear regression with ARMA error correlation (as used by the GLS)?
EDIT: The following code was used to create the GLS and ARIMA models:
arima3a <- arima(train.all$sv,xreg = train.all[,c(5,6)],order=c(2,0,1)) gls3 <- gls(sv~sin+cos,data=train.all,correlation = corARMA(p=2,q=1))
cos variables are equivalent to the variables 5 and 6 in the