我试图使用R中的rugarch库来拟合GARCH(1,1)模型,以预测未来25天的S& P500回报。对于这个例子,我已经将ARIMA p和q分别硬编码为4和4。但是,每次运行此操作时,都会出现优化错误。
以下是代码:
getSymbols("^GSPC", from="2016-01-01")
asset = diff(log(Cl(GSPC)))
returns = as.numeric(asset)
spec = ugarchspec(
variance.model=list(garchOrder=c(1,1)),
mean.model=list(armaOrder=c(
4,4
), include.mean=T),
distribution.model="sged"
)
fit = ugarchfit(
spec, returns, solver = 'hybrid')
这是错误:
Error in optim(init[mask], armaCSS, method = optim.method, hessian =
TRUE, :
initial value in 'vmmin' is not finite