I am trying to reformulate a working ARMA(1, 1) model from EViews in R. I have a quarterly time series of around 45 years and try to perform a rolling ARMA forecast using 12 years of data for estimating the model in each quarter after the initial 12 years. The data consists of logged annual changes in some index-value. The data is not always stationary, but I know that the EViews model works and I have specific results to which I try to be as close as possible to them with my R model. Also, the model must be of the AR(1) MA(1) form.
The EViews code simply rolls through the dataset, estimating following model at each point in time and forecasting with the estimates:
ls(m=1000) data c AR(1) MA(1)
Trying to perform the same thing, my code looks like this:
for (i in 48:NROW(data)) {
fit <- arima(data[(i - 48 + 1):i],
order = c(1, 0, 1),
method = "ML",
optim.control = list(maxit = 1000),
optim.method = "BFGS")
result[i] <- predict(fit, n.ahead = 1)$pred
}
Even though I am using the same data as in EViews, I can't estimate the model in evrey quarter but for some periods either get an error message "Error in solve.default(res$hessian * n.used, A) : Lapack routine dgesv: system is exactly singular: U[1,1] = 0" or a warning of the form "possible convergence problem: optim gave code = 1". In case of the error, the code obviously stops working. Whenever I only get the warnings, my predictions differ greatly from those in EViews.
Can anyone help me estimating such a ARMA(1, 1) model the same way as it is done in EViews? Thank you in advance!