I am running an ARMA (1,1) Garch (1,1) model on some log return stock data. I am interested in backtesting this model on every day and using a rolling window of size 300. Whenever I attempt to do this I receive a convergence error and resulting VaR values of NULL. I tried a few of the suggestions made on her in other threads, including using different solvers, lowering the error tolerance, and using different stock data. Does anyone know why this might be happening?
I am working in R and using the rugarch package, here is the portion of my code where this is done:
spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)), mean.model=list(armaOrder=c(1,1), include.mean = TRUE), distribution="norm") backtest_forecast <- ugarchroll(spec, returns, n.start = 300, refit.every = 1, refit.window = "moving", VaR.alpha = c(0.01, 0.05), solver.control = list(tol = 1e-6),solver = "nloptr")
The following are some of the errors I am getting:
Warning messages: 1: In .sgarchfit(spec = spec, data = data, out.sample = out.sample, : ugarchfit-->warning: solver failer to converge. 2: In arima(data, order = c(modelinc, 0, modelinc), include.mean = modelinc, : possible convergence problem: optim gave code = 1
Here is the data I am using:
prices <- getSymbols('AAPL', src = "yahoo", from="2015-01-01", to="2021-01-01",auto.assign = F)[,2] returns <- diff(log(prices), lag=1) returns <- na.omit(returns)