[R-sig-ME] glmer warning messages using version 1.1.7
Sophia Kyriakou
sophia.kyriakou17 at gmail.com
Thu Mar 12 18:56:57 CET 2015
Hello,
I run a simulation study fitting a GLMM random intercept model and I get
warning messages. I tried various optimizers but they all give warning
messages. Please find below one of the simulated samples.
I am using the lme4 package version 1.1.7 on R 3.1.3.
Do I ignore these warning messages or is there a way of dealing with them?
Thanks in advance.
library(lme4)
library(optimx)
m <- 6
q <- 20
beta <- 2
sigma2 <- 0.1
set.seed(206)
alpha <- rnorm(q, 0, sqrt(sigma2))
Y <- rbinom(q,m,plogis(alpha+beta))
cl <- seq.int(q)
tot <- rep(m,q)
dat <- data.frame(y = Y, tot = tot, cl = cl)
g0.bobyqa <- glmer(cbind(y, tot - y) ~ 1 + (1 | cl), data = dat,family =
binomial(),nAGQ = 20,control=glmerControl(optimizer="bobyqa"))
g0.NM <- update(g0.bobyqa,control=glmerControl(optimizer="Nelder_Mead"))
g0.nlminb <-
update(g0.bobyqa,control=glmerControl(optimizer="optimx",optCtrl=list(method="nlminb")))
g0.LBFGSB <-
update(g0.bobyqa,control=glmerControl(optimizer="optimx",optCtrl=list(method="L-BFGS-B")))
library(nloptr)
## from https://github.com/lme4/lme4/issues/98:
defaultControl <-
list(algorithm="NLOPT_LN_BOBYQA",xtol_rel=1e-6,maxeval=1e5)
nloptwrap2 <- function(fn,par,lower,upper,control=list(),...) {
for (n in names(defaultControl))
if (is.null(control[[n]])) control[[n]] <- defaultControl[[n]]
res <- nloptr(x0=par,eval_f=fn,lb=lower,ub=upper,opts=control,...)
with(res,list(par=solution,
fval=objective,
feval=iterations,
conv=if (status>0) 0 else status,
message=message))
}
g0.bobyqa2 <- update(g0.bobyqa,control=glmerControl(optimizer=nloptwrap2))
g0.NM2 <-
update(g0.bobyqa,control=glmerControl(optimizer=nloptwrap2,optCtrl=list(algorithm="NLOPT_LN_NELDERMEAD")))
dd <- g0.bobyqa at optinfo$derivs
with(dd,max(abs(solve(Hessian,gradient)))<2e-3)
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list