glmer.nb failed to converge

2,779 views
Skip to first unread message

Mila Dunbar-Irwin

unread,
Aug 22, 2014, 1:16:51 AM8/22/14
to davi...@googlegroups.com
Hi D-RUG!

This is my first question. I'm so excited!

I'm trying to see if two sites are significantly different in their fuel loads, and I'm comparing count distributions. I've been trying to use either zeroinflated poissons or negative binomials to fit the data, because there are quite a few zeros and a decent tail. When I run glmer.nb, I'm getting a warning message that says 

Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge: degenerate  Hessian with 1 negative eigenvalues

I've looked online and most of what I've found is confusing and has to do with optimizers but when I tried it it says it can't find "th," which is theta, which seems to me to mean there's something else wrong. There aren't many other answers.

Any thoughts? 

Note: my advisors are really into p-values, and the trouble is that when I use a simple glm with poisson I get no significance and when I run the glmer.nb I get significance. 

Kristina Wolf

unread,
Aug 22, 2014, 1:18:56 AM8/22/14
to davi...@googlegroups.com
Idk the answer, but I do have to ask, how is the "fit" of the poison model? If it's poor, them you shouldn't use it regardless of your p-value, because it is meaningless. 

~ Kristina 

Kristina Wolf
PhD Candidate, U.C. Davis
Restoration and Agricultural Ecology
--
Check out our R resources at http://www.noamross.net/davis-r-users-group.html
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at http://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.

Rosemary Hartman

unread,
Aug 22, 2014, 9:14:02 AM8/22/14
to davi...@googlegroups.com
In general, "model failed to converge" means "It didn't work". You therefore can't trust anything the model output says, including that beautiful p-value (sorry).

If I understand the documentation, the function basically tries a bunch of different values for your model iteratively, and when it fails to converge it tries a bunch of times and can't come out with parameters that work. So it spits out a bunch of nonsense.

When you say you tried different optimizers, which did you use? Your optimizer should be determined by the control = glmerControl object in your model. I think the default is "Nelder_Mead", and the other built-in optimizer is "bobyqa", but there are other packages out there full of optimizers you could try. You can also try feeding it some values to start from (theta is one of your starting values). Giving it the values from the glm might be a good place to start from. I think your model should look something like this:

mymodel = glmer.nb(data=mydata, x~y+z, control=glmerControl(optimizer="bobyqa"), start=list(ST=myfirstmodelstart, fixef= somethingelse ))

I have never actually done this before, and it looks like you can get really complicated really quickly. I'd find a statistician to sit down with.


--
Check out our R resources at http://www.noamross.net/davis-r-users-group.html
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at http://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.



--

Jaime Ashander

unread,
Aug 22, 2014, 10:24:47 AM8/22/14
to davi...@googlegroups.com
My understanding it glmer.nb tries to iteratively estimate an over dispersion param theta during fitting. For your data, at one point during the fit, it creates a nonsense estimate for theta and fails. 

Rosie's suggestion of a different optimizer is good and you might pair that with changes to the maximum number of iterations. See ?glmerControl or example here http://stackoverflow.com/questions/18999329/control-maximum-number-of-iterations-in-lme4-1-0

It's also worth remembering that glmer.nb isn't a very well developed feature of lme4 yet. For example it's described as 'embryonic' in the latest package news http://cran.r-project.org/web/packages/lme4/news.html

You might look at other tools. First see what Zuur has to say. One option is MCMCglmm which takes you into Bayesian territory and won't please your pvalue loving advisors. But Andrew seems to do ok with Bayesian methods in the forest/fire context. 

Yee, Julie

unread,
Aug 22, 2014, 4:41:56 PM8/22/14
to davi...@googlegroups.com
I've been using the glmmadmb function in the glmmADMB package for negative binomial models.  It seems to produce more stable solutions.  Or at least it doesn't complain as much.  It also takes much longer to fit a model (~3-13 minutes) compared to the several seconds that R will run when attempting the same model with glmer.nb.

____________________________________________________
Julie L. Yee, Statistician
U.S. Geological Survey
Western Ecological Research Center

===========================
*** NEW PHONE and FAX ***
===========================

Kevin Welch

unread,
Aug 23, 2014, 4:31:53 PM8/23/14
to davi...@googlegroups.com
Hi Mila,

I will second what Julie said. I use glmmadmb function in the glmmADMB package for negative binomial models. It also allows you to specify zero-inflation in the dependent variable. 

I have run most of my regeneration models with this package and have had good success.

cheers,
Kevin

Reply all
Reply to author
Forward
0 new messages