Dear all,
I have a question about the parallel option of the bootMer function, I hope you can help me with this. I am using R 3.0.1.
I ran a mixed model with the lmer function of the package lme4_1.1-7 and tried to obtain confidence intervals with the bootMer function (in order to get the same results each time, I used set.seed(80)).
In order to divide the bootstrapping calculations over several cores, I used the parallel option of the bootMer function: 'parallel=snow, ncpus=7'. However, I also bootstrapped the model using 'parallel=no', in order to see whether it led to the same results.
The bootstrapping results were the same for 'parallel=snow' and 'parallel=no'. However, when using 'parallel=no', I got the following warnings:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
When using 'parallel=snow', these warnings did not occur. Maybe also important, I do not get these warnings when running the original model.
This is a problem I have encountered with several models. Does someone know why using 'parallel=snow' does not lead to convergence warnings, while using 'parallel=no' does? Are these warnings problematic? Below you find the code I used.
Thanks in advance for your help!
Code:
model_1 <- lmer(DV_continuous ~ factor_threelevels + (1 + factor_threelevels|userId), data=combined_data, control = lmerControl(optCtrl = list(maxfun = 1000000)))
FUN_bootMer <- function(fit) {
return(fixef(fit))
}
set.seed(80)
boot_model_1a <- bootMer(model_1, FUN_bootMer, nsim = 1000, type = "parametric", parallel = "snow", ncpus =7)
set.seed(80)
boot_model_1b <- bootMer(model_1, FUN_bootMer, nsim = 1000, type = "parametric", parallel = "no")
parallel option of the bootMer function: warnings for parallel=no, but not for parallel=snow
2 messages · Spronken, M. (Maitta), Ben Bolker
On 14-10-21 09:45 AM, Spronken, M. (Maitta) wrote:
Dear all,
I have a question about the parallel option of the bootMer function,
I hope you can help me with this. I am using R 3.0.1.
I ran a mixed model with the lmer function of the package lme4_1.1-7
and tried to obtain confidence intervals with the bootMer function
(in order to get the same results each time, I used set.seed(80)).
In order to divide the bootstrapping calculations over several cores,
I used the parallel option of the bootMer function: 'parallel=snow,
ncpus=7'. However, I also bootstrapped the model using 'parallel=no',
in order to see whether it led to the same results.
The bootstrapping results were the same for 'parallel=snow' and
'parallel=no'. However, when using 'parallel=no', I got the following
warnings: 1: In checkConv(attr(opt, "derivs"), opt$par, ctrl =
control$checkConv, : Model failed to converge: degenerate Hessian
with 1 negative eigenvalues 2: In checkConv(attr(opt, "derivs"),
opt$par, ctrl = control$checkConv, : Model failed to converge:
degenerate Hessian with 1 negative eigenvalues
When using 'parallel=snow', these warnings did not occur. Maybe also
important, I do not get these warnings when running the original
model.
This is a problem I have encountered with several models. Does
someone know why using 'parallel=snow' does not lead to convergence
warnings, while using 'parallel=no' does? Are these warnings
problematic? Below you find the code I used.
Thanks in advance for your help!
Code:
model_1 <- lmer(DV_continuous ~ factor_threelevels + (1 +
factor_threelevels|userId), data=combined_data, control =
lmerControl(optCtrl = list(maxfun = 1000000)))
FUN_bootMer <- function(fit) { return(fixef(fit)) }
set.seed(80)
boot_model_1a <- bootMer(model_1, FUN_bootMer, nsim = 1000, type =
"parametric", parallel = "snow", ncpus =7)
set.seed(80)
boot_model_1b <- bootMer(model_1, FUN_bootMer, nsim = 1000, type =
"parametric", parallel = "no")
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Possibly related to https://github.com/lme4/lme4/issues/231 Do you get warnings with parallel="multicore"? I have a suspicion that some of the internal structures of `lme4` may not be getting reset properly when using refit() (which is used internally by confint/bootMer), and that new copies are getting made (and thus reset) with parallel="snow" but not with parallel="no" ... ? Ben Bolker