[R-sig-ME] Obscure convergence warning in optwrap() - convergence code 3 from bobyqa
Michael Cone
coanil at posteo.org
Sun Sep 14 20:03:58 CEST 2014
Using lmer (1.1.7, compiled today from the github master branch), I got
the following warning:
In optwrap(object at optinfo$optimizer, ff, x0, lower = lower, control =
control$optCtrl, :
convergence code 3 from bobyqa: bobyqa -- a trust region step failed
to reduce q
These warnings are thrown while calculating bootstrap confidence
intervals with confint() for a simple repeated-measures model. The
warnings seem to depend on the numerical value of the dependent variable
(see code below).
Likelihood profiling also throws warnings:
1: In optwrap(optimizer, devfun, x at theta, lower = x at lower, calc.derivs
= TRUE) :
convergence code 3 from bobyqa: bobyqa -- a trust region step failed
to reduce q
2: In optwrap(optimizer, par = start, fn = function(x) dd(mkpar(npar1,
:
convergence code 3 from bobyqa: bobyqa -- a trust region step failed
to reduce q
3: In optwrap(optimizer, par = thopt, fn = mkdevfun(rho, 0L), lower =
fitted at lower) :
convergence code 3 from bobyqa: bobyqa -- a trust region step failed
to reduce q
Someone encountered the same warnings in 2013 and, on Ben Bolker's
suggestion, tracked down the Fortran code responsible, but apparently
couldn’t identify the problem.
http://stats.stackexchange.com/questions/89945/meaning-of-a-convergence-warning-in-glmer
Here's an example:
set.seed(12345)
## 30 subjects, 1000 repeated measures on each
subj.true <- rep(rnorm(30, 16000, 3500), each=1000)
df <- data.frame(subj = as.factor(rep(LETTERS[1:30], each=1000)),
subj.true = subj.true,
meas = subj.true + rnorm(30000, 0, 1200))
## this works without errors
fm1 <- lmer(meas ~ 1 + (1|subj), data=df)
boot.pp <- confint(fm1, method="boot", nsim=200)
## this throws 12 identical 'convergence code 3' warnings
df$pct <- 100*(df$meas - df$subj.true)/df$subj.true
fm2 <- lmer(pct ~ 1 + (1|subj), data=df)
boot.pp2 <- confint(fm2, method="boot", nsim=200)
## likelihood profiling gives 3 warnings
lr.pp2 <- confint(fm2)
Is this something obvious/known? I apologize if so, but I didn't find
much regarding this on the web.
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_1.1-7 Rcpp_0.11.2 Matrix_1.1-2 data.table_1.9.2
loaded via a namespace (and not attached):
[1] boot_1.3-9 compiler_3.0.2 grid_3.0.2 lattice_0.20-24
[5] MASS_7.3-29 minqa_1.2.3 nlme_3.1-113 nloptr_1.0.4
[9] plyr_1.8.1 reshape2_1.4 splines_3.0.2 stringr_0.6.2
[13] tools_3.0.2
Michael
More information about the R-sig-mixed-models
mailing list