[R-sig-ME] Help with MCMC fitting in R

Ben Bolker bbolker at gmail.com
Wed May 11 18:07:16 CEST 2016

Janelle Sylvester <jsylves92 at ...> writes:

> Hi,
> I found this email address from the R-Forge website and was hoping you
> could help me with a problem I am having.  I keep getting an error message
> every time I try to preform a *post hoc* Markov chain on my zero-inflated,
> neg. binomial mixed model.  Below is my code and the error message I keep
> getting.  If I can't make this work, can you recommend any other ways of
> validating my model? I really can't find anything on this topic.
> glmmNB<- glmmadmb(CON_XAL~Treatment+(1|Site), data = SR.year.raw,
> > zeroInflation = TRUE, family = "nbinom")
> summary(glmmNB) #Summary output is attached to this email as a picture
> > fit_glmmNB <- glmmadmb(CON_XAL~Treatment+(1|Site),
>                        data=SR.year.raw,
> >                        zeroInflation=TRUE, save.dir = "TMP",
> >                        family="nbinom",
> >                        mcmc=TRUE,
> >                        mcmc.opts=mcmcControl(mcmc=5000))
> And the error message I get:
> Error in R2admb::read_psv(file_name) : no PSV file found
> > In addition: Warning messages:
> > 1: In glmmadmb(CON_XAL ~ Treatment + (1 | Site), data = SR.year.raw,  :
> >   file glmmadmb.std exists: overwriting
> > 2: running command 'C:\Windows\system32\cmd.exe /c glmmadmb -maxfn 500
> > -maxph 5 -noinit -shess -mcmc 1000 -mcsave 1 -mcmult 1' had status 42
> I tried running this:
> mcmc.control <- function(mcmc=50000,


> > }:
> But then when I run my model again, I get this error message:
> Parameters were estimated, but standard errors were not: the most likely
> > problem is that the curvature at MLE was zero or negative
> > Error in glmmadmb(CON_XAL ~ Treatment + (1 | Site), 
> data = SR.year.raw,  :
> >   The function maximizer failed (couldn't find parameter file)


> I've tried for weeks to fix this problem and I just don't know what to do.
> If my data is just not suitable enough for this *post hoc* procedure, can
> you please recommend another way to validate my model so I can ensure that
> it fits well?
> I attached my data and would be happy to send any other information that
> may help figure out a solution.  I am looking at the "Treatment" effect on
> seed abundances of 11 species (ignore ALL_PSI).  Site is my random factor.
> I am looking at species separately.


  It's possible that you're just having problems with an out-of-date
binary: some people reported difficulty like this, and solved it
using instructions at:


  Data and figures get stripped by the mailing list software, so we
haven't seen that (you could send it to me, but I can't guarantee
I'll have time to take a look at it).

  I'm not sure what you're up to with defining mcmc.control there ...

  As far as other solutions go: do you absolutely need the post-hoc
MCMC?  It is nice, but I would generally say that if you do standard
model diagnostics (examine residuals and model predictions, ideally
graphically) it's not an ironclad requirement. (Among other things,
most other non-Bayesian model-fitting methods don't offer this 
feature ...)  Other ways to go to cross-check your model would be:

- fit a zero-inflated Poisson-logNormal with MCMCglmm (a bit of a nuisance,
but doable: search for "owls NCEAS bolker" to find an example)
- use the relatively new/experimental glmmTMB package (install
via devtools::install_github("glmmTMB/glmmTMB",sub="glmmTMB") , 
then library("glmmTMB"); ?Owls for an example)

  Ben Bolker

More information about the R-sig-mixed-models mailing list