[R-sig-ME] glmer error (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate)

Ben Bolker bbolker at gmail.com
Sat Feb 20 17:16:53 CET 2016


	

On 16-02-19 01:37 PM, moses selebatso wrote:
> Hello
> I am running a model on my data, and getting error message. Below is the script and the out put. Any ideas what the problem could be? I can share the data, if required.
>
>> b<-read.csv("clipboard",sep="\t")
>> attach(b)
>> modelb<-glmer(Biomass1~Habitat+Season + (1|Location/Replica), family=Gamma)
> (bG) nan @ pos 12: y= 40.4; mu=-429094; mu inv=-2.33049e-006; wt=1; y/mu=-9.4152e-005; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-858187; mu inv=-1.16525e-006; wt=1; y/mu=-4.7076e-005; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-1.71637e+006; mu inv=-5.82624e-007; wt=1; y/mu=-2.3538e-005; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-3.43275e+006; mu inv=-2.91312e-007; wt=1; y/mu=-1.1769e-005; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-6.8655e+006; mu inv=-1.45656e-007; wt=1; y/mu=-5.8845e-006; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-1.3731e+007; mu inv=-7.28279e-008; wt=1; y/mu=-2.94225e-006; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-2.7462e+007; mu inv=-3.6414e-008; wt=1; y/mu=-1.47112e-006; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-5.4924e+007; mu inv=-1.8207e-008; wt=1; y/mu=-7.35562e-007; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-1.09848e+008; mu inv=-9.10349e-009; wt=1; y/mu=-3.67781e-007; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-2.19696e+008; mu inv=-4.55175e-009; wt=1; y/mu=-1.83891e-007; log(y/mu) =1.#QNAN
> (bG) nan @ pos 12: y= 40.4; mu=-4.39392e+008; mu inv=-2.27587e-009; wt=1; y/mu=-9.19453e-008; log(y/mu) =1.#QNAN
> Error: (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate
> Thank you,
> Mose

When using `lme4` to fit GLMMs with link functions that do not 
automatically constrain the response to the allowable range of the 
distributional family (e.g. binomial models with a log link, where the 
estimated probability can be >1, or inverse-Gamma models, where the 
estimated mean can be negative), it is not unusual to get the error
```
PIRLS step-halvings failed to reduce deviance in pwrssUpdate
```
This occurs because `lme4` doesn't do anything to constrain the 
predicted values, so `NaN` values pop up, which aren't handled 
gracefully. If possible, switch to a link function to one that 
constrains the response (e.g. logit link for binomial or log link for 
Gamma).

===============

This also serves as an advertisement for the updated version of the GLMM 
FAQ, which I have rewritten in R markdown and am in the process of 
moving from wikidot.com to Github. For the rendered HTML, see

https://rawgit.com/bbolker/mixedmodels-misc/master/glmmFAQ.html

For the source, see 
https://github.com/bbolker/mixedmodels-misc/blob/master/glmmFAQ.rmd

Suggestions and corrections (particularly in the form of pull requests, 
but also in the form of issues 
<https://github.com/bbolker/mixedmodels-misc/issues>) welcome ...



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