I am new in R. I am trying to use the covmat
package.
I think the problem in parallel process. This is the code
cl <- makeCluster(detectCores())
clusterExport(cl, varlist = c("lower", "upper", ".obj", "optimx","R"),
envir = environment())
registerDfoParallel(cl)
objmin <- parRapply(cl, start, function (x)
try(optimx(x, .obj, lower = lower, upper = upper, method = method, R = R ,
y.hat = y.hat, Sigma.hat = Sigma.hat, startup_period = startup_period,
training_period = training_period, lambda = lambda), silent=TRUE))
fit <- objmin[[unique(which.min(parSapply(cl, objmin, '[[', "value")))]]
stopCluster(cl)
registerDoSEQ()
And the error is
Error in checkForRemoteErrors(val) : 2 nodes produced errors; first
error: subscript out of bounds
And the debug script
function (val)
{
count <- 0
firstmsg <- NULL
for (v in val) {
if (inherits(v, "try-error")) {
count <- count + 1
if (count == 1)
firstmsg <- v
}
}
if (count == 1)
stop("one node produced an error: ", firstmsg, domain = NA)
***else if (count > 1)
stop(count, " nodes produced errors; first error: ",
firstmsg, domain = NA)***
val
}
I dont know how to solve it. Please help me. Thank you
question from:
https://stackoverflow.com/questions/65871880/error-in-checkforremoteerrorsval-2-nodes-produced-errors-first-error-subsc 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…