[R-sig-ME] glmmTMB warnings and no output Gamma distribution

Willem (Wim) Kaijser w|||em@k@|j@er @end|ng |rom un|-due@de
Wed Feb 5 17:58:53 CET 2020


Can you say something about River and ID in the design. Are the labels 
for the levels of one reused in the levels of the other?

I have 60 rivers and in each river an unique ID (sample location) 
returns. Thus, ID does not re-occur in other rivers and is unique to a 
river. However, it can occur that one river only has one ID and others 
10.
---
Willem (Wim) Kaijser

Fakultät für Biologie
Aquatische Ökologie
Universitätsstr. 5
D-45141 Essen

Room: S05T03B02
Tel: +49.201.183.3113

Mollie Brooks schreef op 05.02.2020 17:00:
> Hi Willem,
> 
>> On 3Feb 2020, at 10:03, Willem (Wim) Kaijser
>> <willem.kaijser using uni-due.de> wrote:
>> 
>> Hello, It was suggested to me to place my question in this
>> mailing-list. I have some problems and lack of knowledge
>> constructing a GLMM with the glmmTMB package (version 0.2.03).
>> Therefore, I am sorry If the explanation is not as sufficient as it
>> should be, and want to thank you in advance for your time.
>> 
>> I try to include both fixed plus random effects and correction for
>> serial correlation in a GLMM with a Gamma distribution (link =
>> "inverse"). However, I get several warnings and the processing time
>> is long, so I prematurely stopped the permutations (see the code
>> below). If the Gamma distribution, with “log” link, is used in
>> the model containing only the fixed and random effects; these
>> warnings do not occur. Including this with the model correcting for
>> serial correlation it does return a warning, but I can extract the
>> residuals (AIC and BIC are returned as NA though). This seems like
>> the following issue: https://github.com/glmmTMB/glmmTMB/issues/329
>> [1]. However, this seems to be resolved. What might be the issue
>> here (is it my coding)?
> 
>> ############################################################
>> #Code with only the fixed and random effects with warnings:#
>> ############################################################
>> 
>> mod1 <- glmTMB(Chla ~ pCO2 + (1|River/ID), family = ”Gamma”,
>> data = df)
>> 
>> There were 19 warnings (use warnings() to see them)
>> Timing stopped at: 33.7 0.08 34.19
>> 
>> Warning messages:
>> 1: In nlminb(start = par, objective = fn, gradient = gr, ... :
>> NA/NaN function evaluation
> 
> This coding looks correct, but can you say something about River and
> ID in the design. Are the labels for the levels of one reused in the
> levels of the other?
> The default in glmmTMB is to use an inverse link with the Gamma family
> because that’s what glm() does in base R, but I don’t actually
> know why. Since the mean has to be positive, I would guess that a log
> link is a good thing to try, but maybe someone else can explain why
> inverse is the default.
> 
>> 
> #######################################################################################
>> #Code with both the fixed, random and correction for serial
>> correlation with warnings:#
>> 
> #######################################################################################
>> 
>> mod2 <- glmTMB(Chla ~ pCO2 + (1|River/ID) + ar1(1|Month), family =
>> ”Gamma”, data = df)
> 
> This coding is not correct. Check out the issue you linked to.
> https://github.com/glmmTMB/glmmTMB/issues/329 [1]
> 
> If Month is an integer, then you could use ar1(Month+0 | X) where X is
> probably ID, or possibly River depending on the design. This also
> depends on if the experiment ran for more than 12 months, in which
> case, you do not want to repeat 1:12 in the second year if it is based
> on calendar months. In ar1(Time +0 | X), you need Time to continue
> counting even if Month repeats according to the calendar in the data.
> 
> Cheers,
> Mollie
> 
>> There were 20 warnings (use warnings() to see them)
>> Timing stopped at: 24.71 0.08 25.49
>> 
>> Warning messages:
>> 1: In FUN(X[[i]], ...) : AR1 not meaningful with intercept
>> 2: In nlminb(start = par, objective = fn, gradient = gr, ... :
>> NA/NaN function evaluation
>> 
>> Best regards,
>> --
>> Willem (Wim) Kaijser
>> 
>> Fakultät für Biologie
>> Aquatische Ökologie
>> Universitätsstr. 5
>> D-45141 Essen
>> 
>> Room: S05T03B02
>> Tel: +49.201.183.3113
>> 
>> _______________________________________________
>> R-sig-mixed-models using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models [2]
> 
> 
> 
> Links:
> ------
> [1] https://github.com/glmmTMB/glmmTMB/issues/329
> [2] https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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