[R-sig-ME] lme4/glmer convergence warnings
Ben Bolker
bbolker at gmail.com
Fri Apr 11 03:35:39 CEST 2014
On 14-04-10 09:01 PM, Corey Sparks wrote:
> Hello all, I’ve been seeing the aforementioned convergence errors for
> weeks in a course i’m teaching using lme4, so I decided to follow
> Ben’s advice on reporting the :
> I’m fitting a binomial GLMM for small area estimation model building
> here:
> glmer(I(bmi>30)~povz+vachousz+baccz+blackz+hispanicz+factor(region)+(1|state)+(1|cofips),
> family="binomial", data=merged, weights=cntywt/mean(cntywt))
>
> n=~240000, n_cofips=217, n_state=46 I get the warning: In
> checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
> Model failed to converge with max|grad| = 0.235915 (tol = 0.001)
>
> and the gradients:
>
> relgrad <- with(fit.1 at optinfo$derivs,solve(Hessian,gradient))
>> max(abs(relgrad))
> [1] 0.0001631008
This is good (relative gradient is less than the 0.001 or 0.002
tolerance we would think to set as a default)
>
> and when I use refit(), I get: fit.1<-refit(fit.1)
>> relgrad <- with(fit.1 at optinfo$derivs,solve(Hessian,gradient))
>> max(abs(relgrad))
> [1] 2.369877e-06
This doesn't really matter so much (as long as we're getting below
tolerance on the relative gradient, I don't care so much if we can
decrease it still further by refitting).
>
> For another model on a LMM, I get:
>
> fit.mix<-lmer(bmiz~agez+lths+coll+black+hispanic+other+(1|cofips),
> brfss_11)
>
> In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,
> : Model failed to converge with max|grad| = 0.00550412 (tol = 0.002)
>
> relgrad <- with(fit.mix at optinfo$derivs,solve(Hessian,gradient))
>> max(abs(relgrad))
> [1] 8.099289e-08
ditto.
>
> Hope this helps
>
Yes, this is encouraging (switching to relative gradients would clear
everything up here)
More information about the R-sig-mixed-models
mailing list