[R-sig-ME] glmmADMB

Mollie Brooks mbrooks at ufl.edu
Tue Jul 12 19:36:14 CEST 2016


Hi Joseph,

> On 12Jul 2016, at 18:46, Tharayil, Joseph (NIH/NINDS) [F] <joseph.tharayil at nih.gov> wrote:
> 
> Hello all,
> 
> I am an undergraduate at the NIH summer internship program, working on
> statistical models of seizure frequency. I am trying to use your R
> package, glmmADMB, for zero-inflated poisson and negative binomial mixed
> models. I have two questions:
> 
>  1. Does the zero inflation parameter returned by glmmadmb() refer to
>     the fraction of instances in which �extra� zeros are observed?

Yes, this is correct.

>  2. I often come across error messages containing the following phrase:
>     "Error in glmmadmb(zeroinfl ~ 1 + (1 | testpatients), data = testdf,
>     zeroInflation = TRUE,  : the function maximizer failed (couldn't
>     find parameter file)�. It seems as though using different data sets,
>     or changing the size of the data set, or using a poisson instead of
>     negative binomial model, solves the problem. Two examples of a full
>     error message, and a minimal code example are shown below.
> 
The function maximizer can fail when the model is difficult to fit to the data for any number of reasons. Maybe Dave Fournier has some expert advice on this. 

To solve the problem in error example 2, you could us the argument extra.args to adjust the command line option ndi. This controls memory allocation.
testZINB<-glmmadmb(zeroinfl~1+(1|testpatients),data=testdf,zeroInflation=TRUE,family='nbinom', extra.args="-ndi 1000000")
For this big of a data set, the negative binomial is really slow. If you really need to deal with data sets this big and if glmmADMB is prohibitively slow on your computer, you could try glmmTMB instead. See https://github.com/glmmTMB/glmmTMB <https://github.com/glmmTMB/glmmTMB> for installation instructions.

testZINB<-glmmTMB(zeroinfl~1+(1|testpatients),data=testdf,zi=~1,family='nbinom1')

cheers,
Mollie

> I would really appreciate any assistance you are able to provide.
> 
> Thank you,
> Joseph Tharayil
> Summer Student
> Clinical Epilepsy Section
> NINDS, NIH
> 
> Minimal code example:
> 
> observations<-rnbinom(100000,size=10, mu=100000)
> randzeros<-rbinom(100000,1,.80)
> zeroinfl<-observations*randzeros
> testpatients<-c()
> k<-0
> for(i in 1:1000)
> {
>  for(j in 1:100)
>  {
>    k<-k+1
>    testpatients[k]<-i
>  }
> }
> testpatients<-as.factor(testpatients)
> testdf<-as.data.frame(cbind(zeroinfl,testpatients))
> testdf$testpatients<-as.factor(testdf$testpatients)
> testZINB<-glmmadmb(zeroinfl~1+(1|testpatients),data=testdf,zeroInflation=TRUE,family='nbinom')
> 
> Error message examples:
> Example 1:
> 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(zeroinfl ~ 1 + (1 | testpatients), data = testdf,
> zeroInflation = TRUE,  :
>   The function maximizer failed (couldn't find parameter file)
> Troubleshooting steps include (1) run with 'save.dir' set and inspect
> output files; (2) change run parameters: see '?admbControl';(3) re-run
> with debug=TRUE for more information on failure mode
> In addition: Warning message:
> running command './glmmadmb -maxfn 500 -maxph 5 -noinit -shess' had
> status 1
> Example 2:
> Need to increase the maximum number of separable calls allowed to at
> least 20001
> Current value is 20000
> Use the -ndi N command line option
> Error in glmmadmb(zeroinfl ~ 1 + (1 | testpatients), data = testdf,
> zeroInflation = TRUE,  :
>   The function maximizer failed (couldn't find parameter file)
> Troubleshooting steps include (1) run with 'save.dir' set and inspect
> output files; (2) change run parameters: see '?admbControl';(3) re-run
> with debug=TRUE for more information on failure mode
> In addition: Warning message:
> running command './glmmadmb -maxfn 500 -maxph 5 -noinit -shess' had
> status 1
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


------------------------
Mollie Brooks, PhD
Postdoctoral Researcher, Population Ecology Research Group
Department of Evolutionary Biology & Environmental Studies, University of Zürich
http://www.popecol.org/team/mollie-brooks/

	[[alternative HTML version deleted]]



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