***
inla.core.safe: inla.program has
crashed: rerun to get better initial values. try=1/1
*** inla.core.safe: rerun with improved initial values
I have the feeling that inla is not finishing for some models an is stuck in a loop.
Maybe it is that. I would appreciate if there is a solution within R. Oven ending this task would me an option and then having an error in my results which states that I should check this model more carefully.
Any help is appreciated
Hannes
Code:
library(foreach)
library(future)
library(doFuture)
library(doRNG)
doFuture::registerDoFuture()
doRNG::registerDoRNG()
plan(multisession, workers = 32)
for (i in 473:n.dic) {# used from 427
top = dic.model.list[((i - 1) * split.dic + 1):(i * split.dic)]
tic()
result = foreach(iter = top, .packages = c("INLA", "sf", "dplyr")) %dopar% {
tryCatch({
cat("Starting iteration:", iter, "\n")
inla_output = inla_cv_bin_MM3(data_train = data_train_z_scaled,
coords_train = coords_cv1,
cov = iter)
gc()
list(values = data.frame(CPO = -mean(log(inla_output$fit$cpo$cpo)),
N.Failures = sum(inla_output$fit$cpo$failure),
WAIC = inla_output$fit$waic$waic,
DIC = inla_output$fit$dic$dic,
cov = paste0(iter, collapse = ","),
N.cov = length(iter),
N.cov.sig = sum(inla_output$fit$summary.fixed[, 3] > 0 |
inla_output$fit$summary.fixed[, 5] < 0)),
fixed = inla_output$fit$summary.fixed,
hyper = inla_output$fit$summary.hyperpar)
}, error = function(e) {
cat("Error in iteration:", iter, "Message:", e$message, "\n")
NULL
})
}
saveRDS(result, paste0("C:/Users/results.",paste0(i),".rds"))
toc()
print(i)
}
--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/r-inla-discussion-group/262e71ca-1d46-49c4-a657-740a4630a415n%40googlegroups.com.