[R-sig-ME] working around glm.fit: "fitted probabilities numerically 0 or 1 occurred"

Jack Tanner ihok at hotmail.com
Sat Aug 25 06:22:45 CEST 2012


On 8/24/2012 6:43 AM, S Ellison wrote:
> This does not necessarily mean the fit has not converged; it is usually just a warning that some predicted probabilities at some point during the process of fitting were so close to 0 or 1 that they cannot be properly represented in finite precision arithmetic. That does not, of itself, prevent convergence, and you have already nicely demonstrated that the problem occurred on early iterations but not later, better, estimates.
>
> Are you sure you need to work round it?

I got it! But I still have a question. Why does the start parameter to 
lmer() only take ST and fixef, and not starting ranef values?

I did need to work around it lmer's warnings. On the one hand, lmer did 
produce a fitted mer object. On the other, it printed only a single 
iteration under verbose=TRUE. It never performed additional iterations. 
The estimates from verbose contained a lot of NaN values. The warnings I 
got were

Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred
2: In mer_finalize(ans) : gr cannot be computed at initial par (65)

What worked was that I initialized a new run of lmer(..., 
start=my_start), where my_start used ST and fixef values from a 
successful fit that did not include the covariant matrices. The first 
time I tried this, I got an additional warning.

Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred
2: In sort(names(start)) == sort(names(FL)) :
   longer object length is not a multiple of shorter object length
3: In mer_finalize(ans) : gr cannot be computed at initial par (65)

The new warning (2) made sense, because the covariant matrices require 
the estimation of additional parameters not included in the previous 
fit. I padded the fixef component of my_start with some rnorm(mean=0, 
sd=.2) values, and presently, lmer is on iteration 67!

So, why doesn't lmer's start parameter take ranef values?



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