在 r 中回测 garch
backtesting garch in r
我正在尝试使用 ugarchroll 回测我的 arch 模型,但我收到此警告消息
”警告信息:
在 .rollfdensity(spec = spec, data = data, n.ahead = n.ahead, forecast.length = forecast.length, :
非收敛估计windows存在...重新提交具有不同求解器参数的对象。
这是我的代码
library(quantmod)
library(rugarch)
getSymbols("SPY")
rets=ROC(SPY$SPY.Close)
tgarch = ugarchspec(mean.model = list(armaOrder = c(1, 1)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
garchroll<-ugarchroll(tgarch, data = rets,n.start =500,
refit.window="window", refit.every =200)
当您申请 ROC()
时,第一个条目变为 NA
。因此,当您应用 ugarchroll()
时,您想将其从 rets
中排除。因此,
garchroll <- ugarchroll(tgarch, data=rets[-1, ], n.start=500,
refit.window="window", refit.every=200)
我正在尝试使用 ugarchroll 回测我的 arch 模型,但我收到此警告消息
”警告信息: 在 .rollfdensity(spec = spec, data = data, n.ahead = n.ahead, forecast.length = forecast.length, :
非收敛估计windows存在...重新提交具有不同求解器参数的对象。
这是我的代码
library(quantmod)
library(rugarch)
getSymbols("SPY")
rets=ROC(SPY$SPY.Close)
tgarch = ugarchspec(mean.model = list(armaOrder = c(1, 1)),
variance.model = list(model = "sGARCH"),
distribution.model = "std")
garchroll<-ugarchroll(tgarch, data = rets,n.start =500,
refit.window="window", refit.every =200)
当您申请 ROC()
时,第一个条目变为 NA
。因此,当您应用 ugarchroll()
时,您想将其从 rets
中排除。因此,
garchroll <- ugarchroll(tgarch, data=rets[-1, ], n.start=500,
refit.window="window", refit.every=200)