[R-sig-ME] Warnings BootMer bootstrap glmer lme4
D.J. Damen
D.J.Damen at uvt.nl
Fri Jun 9 15:31:51 CEST 2017
Dear Ben,
Thank you very much for your kind reply and nice suggestions.
This seems like a moderately complex model (2 4x4 variance-covariance
matrices); how big is your data set (total observations, number of id
levels, number of item.new levels)? I wouldn't be surprised if you're
getting some singular fits. On the other hand, the gradient warnings
are fairly small.
True, it is. Total observations = 3600, number of ID levels = 90 (30 IDs per condition), number of item.new levels = 40.
In more detail: the 90 participants (i.e., ID) were allocated to one of the three conditions (i.e., c.con.tr) and were all confronted to 40 items (i.e., items.new), divided into test (20) and control items (20) (i.e., .type.tr), but these test and control items were either manipulated to appear in color (10) or size (10) (i.e., c.diff.tr).
In addition, I was also wondering whether my bootstrapping code is correctly specified? I am currently using the following code:
FUN <- function(fit) {
return(fixef(fit))
}
boost <- function(mdl){
name <- match.call()$mdl
boosted <- bootMer(mdl, FUN, nsim = 100)
save(boosted,file=paste(name,"_boosted",sep=""))
}
I have not specified the type = c(“parametric”) nor provided a parallel function, should I do so?
Some suggestions:
- (unrelated to your question) if you have small numbers of
observations *per* id (or item), you should consider using Gauss-Hermite
quadrature (e.g. nAGQ=10)
I will definitely try this.
- check to see whether the profile confidence intervals agree
reasonably well with the bootstrap Cis
Then I have to ask for type = perc Cis, am I right?
- you could use blme::bglmer to regularize your model to avoid
Singularities
Thank you!
- or try an alternative approach like brms to double-check
Thank you, again :).
Best, Debby
From: D.J. Damen
Sent: vrijdag 19 mei 2017 12:44
To: r-sig-mixed-models at r-project.org
Subject: Warnings BootMer bootstrap glmer lme4
Dear all,
Currently, I am using the BootMer function to bootstrap my final model (fitted with GLMER from the lme4 package) to estimate the confidence intervals and p-values. Since I am alternating my reference categories, I have to bootstrap several models, and now the bootstrap of one model (below) returns with 50 or more warnings. Is there a standard procedure to follow when this happens? Should I trust the bootstrap when warnings pop up?
I am fitting a binomial model with the (centered and treatment coded) predictors c.con.tr (3 levels), c.type.tr (2 levels), and c.diff.tr (2 levels), and the dependent variable “contrast” (1 = mentioned; 0 = not mentioned).
Details about the model I want to bootstrap, the bootstrap function and the warnings are presented below:
Model:
m0bcc <-glmer (contrast~c.con.tr*c.type.tr*c.diff.tr+(1+c.type.tr+c.diff.tr|id)+(1+c.con.tr+c.type.tr|item.new), data=mydata, family=binomial (link='logit'), control=glmerControl(optimizer="bobyqa"))
Bootstrap function:
FUN <- function(fit) {
return(fixef(fit))
}
boost <- function(mdl){
name <- match.call()$mdl
boosted <- bootMer(mdl, FUN, nsim = 100)
save(boosted,file=paste(name,"_boosted",sep=""))
}
p_boosted <- function(mdl,boosted){
for (n in 1:length(fixef(mdl))){
print(fixef(mdl)[n])
(bMCI <- boot.ci(boosted, conf = c(0.95, 0.99, 0.999), index=n, type="norm"))
print(bMCI)
}
}
Warnings: ( posted the first 10 warnings, in total there were 50 (or more?).
mdl <- m0bcc
> boosted <- bootMer(mdl, FUN, nsim = 100)
There were 50 or more warnings (use warnings() to see the first 50)
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
unable to evaluate scaled gradient
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
unable to evaluate scaled gradient
4: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model failed to converge: degenerate Hessian with 2 negative eigenvalues
5: In optwrap(object at optinfo$optimizer, ff, x0, lower = lower, ... :
convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded
6: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model failed to converge with max|grad| = 0.00176467 (tol = 0.001, component 1)
7: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
unable to evaluate scaled gradient
8: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
9: In optwrap(object at optinfo$optimizer, ff, x0, lower = lower, ... :
convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded
10: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
Model failed to converge with max|grad| = 0.00258682 (tol = 0.001, component 1)
11: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, ... :
I couldn’t find whether I should decrease the random effects structure of my fitted model to decrease these bootstrap warnings, but since my fitted glmer model did converge, I am hesitant to do so anyway. I hope somebody is able to shed some light on this matter.
Thank you very much in advance.
Best, Debby
Debby Damen
PhD Student
Department of Communication and Information Science
Tilburg University
Warandelaan 2, room D410
5037 AB Tilburg
T. +31 13 466 8245
M. d.j.damen at uvt.nl<mailto:d.j.damen at uvt.nl>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list