SARIMA script from R to Eviews
Posted: Fri Dec 04, 2015 2:26 am
by Franpaz
I've recibed this R script
Modelo3 = arima(Data$Table, xreg = Table[,5:9], order = c(4, 0, 0), seasonal = list(order = c(1, 1, 0) , period = 12), include.mean = F , fixed = c(NA, 0, NA, NA, NA, NA, NA, NA, NA, NA) )
and I want to replicate it in Eviews. Do you know how can i do this?
Thanks a lot,
Re: SARIMA script from R to Eviews
Posted: Sat Dec 05, 2015 8:32 am
by xprimexinverse
The model (Modelo3) is a SARIMAX model. That is, a seasonal ARIMA model with exogenous variables.
Let's break down the R code and then figure out what needs to be done in EViews.
- Data$Table is a univariate time-series. It is the dependent (left-hand side) variable in the model.
- Table[,5:9] refers to 5 exogenous variables.
- c(4,0,0) refers to the non-seasonal part of the SARIMA model for Data$Table. It specifies an AR(4).
- c(1, 1, 0) refers to the seasonal part of the SARIMA model for Data$Table. It specifies AR(1) with first seasonal differencing.
- include.mean = F just means do not include an intercept term (which is usual if the series being modelled has been differenced).
- fixed = c(NA, 0, NA, NA, NA, NA, NA, NA, NA, NA) is used to impose a constraint on the second parameter in the model (second argument is set equal to zero).
Now that we can interpret the R code correctly and understand the econometric model(!)... we can go to EViews.
To specify the general model, the code should like what follows. Obviously, you'll have to change the names of the variables, but that's easy.
Code: Select all
ls d(ENDOG, 0, 12) AR(1 to 4) SAR(1) EXOG1 EXOG2 EXOG3 EXOG4 EXOG5
If I'm not mistaken, the 0 constraint is on the second AR term, so you can impose this constraint by adjusting the EViews code slightly. (
Double check this).
Code: Select all
ls d(ENDOG, 0, 12) AR(1) AR(3 to 4) SAR(1) EXOG1 EXOG2 EXOG3 EXOG4 EXOG5
Lastly, if you have a lot of R code to run, you might consider using the xrun command in EViews.
Re: SARIMA script from R to Eviews
Posted: Mon Dec 14, 2015 8:06 am
by Franpaz
Thank you very much.
Re: SARIMA script from R to Eviews
Posted: Mon Dec 14, 2015 1:00 pm
by xprimexinverse
No problem. Actually, you may want to check that the EViews code is SAR(1) or SAR(12). Maybe one of the EViews guys can confirm the correct one. Good luck!
Re: SARIMA script from R to Eviews
Posted: Mon Dec 14, 2015 3:14 pm
by EViews Gareth
SAR(12).