[R-sig-ME] Error from glmmTMB().

Mollie Brooks mo|||eebrook@ @end|ng |rom gm@||@com
Tue Mar 17 14:50:46 CET 2020


It may be an overparameterization issue because I was able to get simpler models to work. We could make the error message clearer, but tried to document it at the bottom of the troubleshooting vignette. The general advice in that case is to (1) try rescaling predictor variables, (2) try a simpler model and build up, and (3) try different starting values, possibly based on a simpler model. 

I tried scaling Dose that that didn’t help. 

To get the right shape for starting values, you could check the structures in the unfitted model

mod  <- glmmTMB(fmla, data = X, family = betabinomial(link = "cloglog"),
              dispformula = ~1, doFit=FALSE)

dimnames(mod$data.tmb$X)[[2]]

dimnames(mod$data.tmb$Z)[[2]]

str(mod$parameters)

start <- list(beta=rep(0.1, 12), b=rep(.01, 12)) #fill in better values based on your best guess

fit3  <- glmmTMB(cbind(Dead, Alive) ~ Trt+0 +Dose + (1 | Rep), data = X, family = betabinomial(link = "cloglog"))


start <- list(beta = c(fixef(fit3)[[1]][1:6], rep(.1, 6)),
	b=c(unlist(ranef(fit3)[[1]]$Rep), rep(.1, 6)))
	
fit  <- glmmTMB(fmla, data = X, family = betabinomial(link = "cloglog"), start=start)

That was my best attempt at getting it to run, but it doesn’t work. 

If you think this is a bug, you could add it to the issue tracker on GitHub.

cheers,
Mollie

> On 15Mar 2020, at 4:32, Rolf Turner <r.turner using auckland.ac.nz> wrote:
> 
> 
> I am getting an error, that I have no idea what to do about, from glmmTMB():
> 
> library(glmmTMB)
> fmla <- cbind(Dead, Alive) ~ (Trt + 0)/Dose + (Dose | Rep)
> X    <- dget("X.txt")
> fit  <- glmmTMB(fmla, data = X, family = betabinomial(link = "cloglog"),
>               dispformula = ~1)
> 
>> Error in optimHess(par.fixed, obj$fn, obj$gr) :   gradient in optim evaluated to length 1 not 16
>> In addition: There were 16 warnings (use warnings() to see them)
> 
> The warnings are all repetitions of
> 
>> 1: In nlminb(start = par, objective = fn, gradient = gr,  ... :
>>  NA/NaN function evaluation
> 
> The error sounds to me like something is amiss in the code.
> 
> Can anyone confirm/deny/suggest what I might do to get this call to glmmTMB() to run?
> 
> Thanks.
> 
> cheers,
> 
> Rolf Turner
> 
> P.S.  The data set is attached.
> 
> -- 
> Honorary Research Fellow
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> <X.txt>_______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


	[[alternative HTML version deleted]]



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