r - R并行包错误:一个节点产生错误:没有适用的“收敛”方法应用于“try-error”类的对象
问题描述
最近我一直在尝试自己研究 R 中的 2-stage DCC 模型。发现一篇很有帮助的文章:https ://www.r-bloggers.com/the-garch-dcc-model-and-2-stage-dccmvt-estimation/
但是,我被困在了
install.packages("rmgarch")
library(rmgarch)
install.packages("parallel")
library(parallel)
data(growthrates)
Dat = growthrates2[, 1:7, drop = FALSE]
# define a DCCspec object: 2 stage estimation should usually always use
# Normal for 1-stage (see below for
xspec = ugarchspec(mean.model = list(armaOrder = c(1, 1)), variance.model = list(garchOrder = c(1,1), model = 'eGARCH'), distribution.model = 'norm')
uspec = multispec(replicate(7, xspec))
spec1 = dccspec(uspec = uspec, dccOrder = c(1, 1), distribution = 'mvnorm')
spec1a = dccspec(uspec = uspec, dccOrder = c(1, 1), model='aDCC', distribution = 'mvnorm')
## aDDC for asymmetric DCC; The distributions supported are the multivariate normal (“mvnorm”) and the multivariate affine NIG (“manig”) and GHYP (“magh”) distributions of Schmidt
spec2 = dccspec(uspec = uspec, dccOrder = c(1, 1), distribution = 'mvlaplace')
spec2a = dccspec(uspec = uspec, dccOrder = c(1, 1), model='aDCC', distribution = 'mvlaplace')
cl = makePSOCKcluster(7)
## stopCluster(cl)
showconnections()
print(class(cl))
multf = multifit(multispec=uspec, Dat, cluster = cl)
每一行代码都运行顺利,直到 multifit 的最后一行。错误显示:
> multf = multifit(multispec=uspec, Dat, cluster = cl)
Error in checkForRemoteErrors(val) :
one node produced an error: no applicable method for 'convergence' applied to an object of class "try-error"
我试图在网上搜索,有人说可能是数据集中存在 na 值,但我的数据集中没有 na 值。
那么错误的原因可能是什么?谢谢
编辑:在代码的最后一行将“dat2”替换为“Dat”以避免混淆。
解决方案
推荐阅读
- php - PHP:请帮助解释这些三元运算符
- javascript - 将图像添加到跨度
- c++ - 我应该在此功能中更改什么才能使灰度图像正常工作
- swiftui - 基于单元格大小的可变 Rectangle() 尺寸以绘制时间线
- python - Python - 使用多个分隔符拆分字符串,返回字典分隔符作为键剩余项作为值
- c++ - 隐式实例化在实例化中是必须的吗?
- elasticsearch - 如何在弹性搜索中比较来自两个不同特定日志的两个源 IP
- macos - 为什么我的 MacOS 终端每次启动时都要求输入密码?
- css - 我无法从我的应用程序的 css 文件访问公用文件夹
- flutter - flutter_map 缩放和 pannig 冻结