[R] help with glmmADMB ZI; function maximizer failed

emmarosenfeld emmarosenfeld at hotmail.co.uk
Thu Oct 20 16:36:33 CEST 2011


bbolker wrote:
> 
> emmarosenfeld <emmarosenfeld <at> hotmail.co.uk> writes:
> 
>> 
>> Dear all,
>> 
>> I am having some problems trying to run a GLMM model with zero-inflation
>> using the alpha version of glmmADMB (0.6.4) using R (2.13.1) in Windows
>> and
>> I would greatly appreciate some help. 
>> My count response variable (number of birds: count) fits a negative
>> binomial
>> distribution and the explanatory variables are both continuous and
>> categorical (species= 17). The three random effects are site (68 of
>> them),
>> season (1 or 2) and land class (1 to 6). 
> 
>   You mean species is a factor with 17 levels?
> 
> I am trying to analyse the count data of 17 different species in the same
> model as it's a community based analysis.
> 
>   What are the results of str(srp12) ?
> 
> Results=
> 'data.frame':   2312 obs. of  12 variables:
>  $ site     : Factor w/ 68 levels "site1","site10",..: 1 12 23 33 54 65 67
> 68 2 3 ...
>  $ season   : Factor w/ 2 levels "season1","season2": 1 1 1 1 1 1 1 1 1 1
> ...
>  $ count    : int  23 9 6 14 12 6 10 4 9 7 ...
>  $ species  : Factor w/ 17 levels "B","BF","BT",..: 1 1 1 1 1 1 1 1 1 1
> ...
>  $ site.1   : Factor w/ 68 levels "site1","site10",..: 1 12 23 33 54 65 67
> 68 2 3 ...
>  $ built    : num  0.274 0.297 0.326 0.27 0.337 ...
>  $ atrees   : num  0.0482 0.0498 0.0443 0.0822 0.0523 ...
>  $ btrees   : num  0.81 0.847 0.884 0.88 0.851 ...
>  $ Ctrees   : num  16.8 17 19.9 10.7 16.3 ...
>  $ landclass: Factor w/ 6 levels "land1","land2",..: 3 3 3 3 3 3 3 3 3 3
> ...
>  $ distance : Factor w/ 1 level "dist0500": 1 1 1 1 1 1 1 1 1 1 ...
>  $ distcont : int  500 500 500 500 500 500 500 500 500 500 ...
> 
>  
>   You are going to have a lot of difficulty fitting a random effect
> to a factor with two levels (see http://glmm.wikidot.com/faq for
> discussion).  Try it as a fixed effect instead.
> 
> Are you referring to season as a factor with two levels? I'll try it as
> fixed instead.
> 
>> Ideally I would also like to build
>> in a variance structure to allow a different spread per land class.
> 
>   I don't know of a way to do this in glmmADMB. **Maybe** doable
> in MCMCglmm but I wouldn't count on it.
> 
>> This is
>> the model I'm trying to run: 
>> (fm<-glmmadmb(count~species*btrees+species*built+species*btrees*built+
>  (1|season)+(1|landclass)+(1|site),
>    data=srp12, famil="nbinom", zeroInflation=TRUE))
> 
>   Are you aware that species*btrees*built expands to include
> all main effects, two- and three-way interactions, i.e. the
> species*btrees and species*built terms are redundant.
> 
> I hadn't realised that species*btrees*built allows for both two- and
> three- way interactions, no, i thought I had to specify those. Thanks for
> that.
> 
>> I have read most of the supporting documents to glmmADMB and studied the
>> examples but am still struggling to make headway.
>> 
>> This is the error message I get; 
>> 
>> Memory allocation error -- Perhaps you are trying to allocate too much
>> memory in your program 
>> Warning: running command 'C:\Windows\system32\cmd.exe /c
>> "C:/R-2.13.1/library/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500' had
>> status 1
>> Warning in shell(cmd, invisible = TRUE) :
>>   '"C:/R-2.13.1/library/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500'
>> execution failed with error code 1
>> Error in glmmadmb(count ~ species * btrees + species * built + species * 
>> : 
>>   The function maximizer failed
> 
>     
>> 
>> I have also run: 
>> 
>> > summary(fm)
>> 
>> Which results in:
>> 
>> Error in summary(fm) : object 'fm' not found
> 
>   Well, that's not surprising since the command failed.
>> 
>> This has happened however the equation is labelled.
>> 
>> Perhaps there is a more appropriate package that I should be using
>> (MCMCglmm)?
>> I am quite new to R, so it is quite possible that I am missing something,
>> so
>> any help would be most appreciated.
>>
> 
> ______________________________________________
> R-help@ mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 


--
View this message in context: http://r.789695.n4.nabble.com/help-with-glmmADMB-ZI-function-maximizer-failed-tp3918994p3922092.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list