[ADMB Users] Fw: Function Maximizer Failed in glmmADMB using Beta Distribution

Andrew Harbicht aharbicht at yahoo.ca
Sat Dec 10 09:17:00 PST 2011


Thank you for the speedy replies Ben and Dave,

I've since retried my models with the suggested changes to the extra arguments for models that returned the error "Function Maximizer Failed" . Adding ", admb.opts = admbControl(shess = FALSE, noinit = FALSE)"  seems to have done the trick. 

Thanks again,

Andrew Harbicht



On 11-12-09 08:16 PM, dave fournier wrote:
> Try running it from outside R. It appears to work for me that way.
> Of course I'm not saddled with a MAC.

Ben wrote:
  The problem is apparently with some of the extra arguments that we
decided to use in glmmADMB, in particular -shess -noinit.  If you
turn these off by adding admb.opts=admbControl(shess=FALSE,noinit=FALSE)
then glmmADMB gets all the way through, albeit with some warnings in
one case.

  On the other hand, you get almost the same answer by averaging the
Admix value by lake (which is fairly reasonable since the predictor
variables are constant per lake) and running a quasibinomial model
(which is a quick/cheesy way to get a variance proportional to p*(1-p)
and a logistic curve with respect to the predictors) ...

  Watch out for bogus line breaks below.

adat <- read.table("admix_small_data.txt",header=TRUE, na.strings="na")
library(MASS)
library(glmmADMB)

adat <- transform(adat,Lake=reorder(Lake,Admix))
library(reshape)
am <- melt(adat,id.var=c("Lake","Admix"))
library(ggplot2)
g1 <-
ggplot(am,aes(x=value,y=Admix,colour=Lake))+facet_grid(.~variable,scale="free")+
  geom_smooth(aes(group=1),method="glm",family="binomial")+theme_bw()+
  scale_colour_manual(breaks=levels(am$Lake),

value=colorRampPalette(colors=c("red","blue"))(length(levels(am$Lake))))

g1 + geom_boxplot()
g1 + stat_summary(fun.data="mean_cl_boot")

glmm4<-glmmadmb(formula = Admix ~ SDI + (1|Lake), data = adat, family =
"beta",
                admb.opts=admbControl(shess=FALSE,noinit=FALSE))

glmm4<-glmmadmb(formula = Admix ~ SDI + (1|Lake), data = adat, family =
"beta",
                save.dir="gtmp",admb.opts=admbControl(run=FALSE))
glmm4B <- glmmadmb(formula = Admix ~ SDI + (1|Lake), data = adat, family
= "beta",
                save.dir="gtmp",admb.opts=admbControl(run=FALSE))


glmm8<-glmmadmb(formula = Admix ~ pH + (1|Lake), data = adat, family =
"beta")

glmm8 <- glmmadmb(formula = Admix ~ pH + (1|Lake), data = adat, family =
"beta",
                admb.opts=admbControl(shess=FALSE,noinit=FALSE))
## warnings but finishes
glmm15<-glmmadmb(formula = Admix ~ StMonth + (1|Lake), data = adat,
family = "beta",
                 admb.opts=admbControl(shess=FALSE,noinit=FALSE))


glmmnew <-glmmadmb(formula = Admix ~ pH+ StMonth + SDI +  (1|Lake), data
= adat, family = "beta",
                 admb.opts=admbControl(shess=FALSE,noinit=FALSE))

mdat <- ddply(adat,.(Lake),
              function(x) { with(x,
                                 data.frame(Lake=Lake[1],
                                            pH=pH[1],
                                            StMonth=StMonth[1],
SDI=SDI[1], Admix=mean(Admix)))})

m2 <- glm(Admix~pH+StMonth+SDI,data=mdat,family=quasibinomial())

library(betareg)
m4 <- betareg(Admix~pH+StMonth+SDI,data=mdat) ## hmmm.

library(coefplot2)
coefplot2(list(glmmnew,m2))
_______________________________________________
Users mailing list
Users at admb-project.org
http://lists.admb-project.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20111210/1f8f427b/attachment.html>


More information about the Users mailing list