r - 使用 Ugarchroll 在 for 循环中拟合数据:如何摆脱以下警告消息?--> 可能的收敛问题:优化给出的代码 = 1
问题描述
我收到以下警告消息,我想摆脱但我不明白:
possible convergence problem: optim gave code = 1
贝娄是我的代码:
# Creating the specification with ugarchroll
library("rugarch")
garch_spec_N <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(1, 1), include.mean = TRUE),distribution.model = "norm")
nsim <- 2 # number of simulations
nstart <- 500
simul_ <- matrix(rnorm(2000), nrow = 1000, ncol = nsim))
# Model fitting
garch_sigma_N <- garch_mu_N <- matrix(NA, nrow = nstart, ncol = nsim)
for (i in 1:nsim) {
garch_fit_N <- ugarchroll(garch_spec_N, simul_[,i], n.ahead = 1,
forecast.length = 1, n.start = nstart,
refit.every = 1, refit.window = "moving",
window.size = nstart, calculate.VaR = TRUE,
VaR.alpha = alpha)
# Retrieving estimated garch variance and Mu
garch_sigma_N[,i] <- garch_fit_N@forecast[["density"]][["Sigma"]]
garch_mu_N[,i] <- garch_fit_N@forecast[["density"]][["Mu"]]
}
任何帮助将不胜感激:)
解决方案
推荐阅读
- aem - AEM 响应式网格将自定义按钮添加到编辑栏
- r - 如何在 R 例如 5-10 的列中对范围内的值进行分组?
- types - 'and'类型说明符不应该短路吗?
- android - 添加华为套件时出现“找不到 com.huawei.hms:location:6.0.0.302”错误
- android - 小米9T如何在没有网络的情况下获取当前位置?
- android - 如何在作为选项卡的 2 个片段之间共享视图模型
- reactjs - 从 reactjs 数据文件中的文件夹加载图像并传递给 jsx 文件
- python - Numpy:如何使用在另一个矩阵的行中找到的索引来索引一个矩阵的行?
- javascript - for 循环遍历日期以检查是否相同
- azure-devops - 提取任务时 Azure devops 代理失败:目录不为空