[R-sig-ME] Mixed Models convergence problems, Jordi Rosich

Toni Hernandez-Matias ahmatias at gmail.com
Fri Dec 2 12:20:54 CET 2016


Dear all,

Could some one help us with this problem of convergence?

Our alternative is only using 1 observation per territory and then using
glm instead of glmm, but we will miss a lot of info.

Many thanks!

Toni

On Tue, Nov 22, 2016 at 3:20 PM, Jordi Rosich <jordirosich16 at gmail.com>
wrote:

> Thank you very much for your answer,
>
>
> We have checked some of the possible solutions you proposed as well as the
> ?convergence help page:
>
>
>
>
> -Center and scale predictor variables didn’t solve the convergence problems
> because our variables are components obtained in a PCA analysis and are
> “already centered”.
>
>
> -Increasing the number of iterations of the optimizer didn’t solve the
> convergence problem in all the different models.
>
> -We didn’t check singularity or recompute gradient and Hessian with
> Richardson extrapolation as we got unexpected values in some parts of
> the process or didn’t fully understand how the process works.
>
> -We tried to run the models with different optimizers as explained in the
> ?convergence page and got the attached output. It seems that changing the
> optimizers didn't
>
>
>
>
>
> One of the reasons we think our models could continue to fail is because in
> our data (see previous mail for details) the levels of the random factor
> Territory totally explain if a tree/nest-site/landscape is occupied or
> unoccupied. For exemple, in Territory 1 all four trees/nest-site
> forests/landscapes are occupied; in Territory 15 all three trees/nest-site
> forests/landscapes are unoccupied. This happens with all our territories,
> all nests/"no-nests" of a territory are either occupied or unoccupied.
> Could this situation be problematic when estimating the random factor
> variance and thus, is there a possibility that the convergence problem has
> a relation with this fact?
>
>
> Thank you in advance. Waiting for your answer,
>
>
>
> Jordi Rosich
>
> 2016-11-15 6:19 GMT+01:00 Phillip Alday <Phillip.Alday at unisa.edu.au>:
>
> > Hi Jordi,
> >
> > Without really knowing anything about your data (or more generally
> > types of data common to your field) ....
> >
> > - Your model doesn't seem exceptionally complex -- just main effects
> > and a single scalar (intercept-only) random effect. Of course, a simple
> > model can still be "too" complex if you don't have much data.
> >
> > - However, it sometimes makes sense to use a more complicated model
> > when you have convergence issues on a simple model -- sometimes, you
> > really do need covariates to get any type of decent fit. (Based on your
> > email, you may have already  experienced this.)
> >
> > - Categorical variables are particularly 'nasty' when it comes to the
> > number of model parameters as a categorical variable with n levels
> > requires n-1 parameters in the model! Continuous variables only require
> > 1 parameter apiece (correlation parameters in the random effects
> > excepted).
> >
> > - Watch out for multicollinearity -- how strongly do tree height and
> > tree width correlate with each other?
> >
> > - Your particular convergence warning often means that the optimiser
> > was still moving along towards convergence / the solution when
> > optimisation was stoppe. Sometimes this can be helped by just
> > increasing the number of iterations that the optimiser is allowed to
> > take, although this will increase computer time.
> >
> > - Make sure to check out the help page: ?convergence (after loading
> > lme4) has many tips and tricks.
> >
> > Best,
> > Phillip
> >
> > On Mon, 2016-11-14 at 22:33 +0100, Jordi Rosich wrote:
> > > Hello,
> > >
> > >
> > >
> > > I'm Jordi Rosich, a student currently collaborating with the Biology
> > > Conservation Group of the University of Barcelona. I'm writing you
> > > because
> > > I'm having model convergence troubles with some GLMMs using the
> > > function
> > > glmer of the package lme4 of R.
> > >
> > > Our research addresses nest-site selection of the Goshawk, a
> > > territorial
> > > bird of prey, and specifically we aim to understand which
> > > environmental
> > > variables are relevant for nest site-selection in this species.
> > >
> > >
> > >
> > >
> > > *Our approach**:*
> > >
> > > 1)     We sampled several environmental variables in sites used by
> > > this
> > > bird species in nest (1) and unoccupied sites (0), and therefore
> > > occupation
> > > status (0/1) is our dependent variable and the environmental
> > > variables our
> > > independent variables.
> > >
> > > 2)     We performed  three analysis at 3 different spatial-scales:
> > > nest
> > > tree, nest-site forest (being the 18 meters radius circular area
> > > around the
> > > nest-tree), and landscape around nest-site (500 meters radius
> > > circular area
> > > around the nest-tree).
> > >
> > > 3)     We sampled 29 Goshawk nests comprised in 13 breeding pairs
> > > territories (each territory may hold several nests) and 30 control
> > > non-occupied random trees comprised in 25 "pseudo-territories" (the
> > > near
> > > trees being included in this "territories"). To avoid
> > > pseudoreplication of
> > > nests of the same breeding pair (or territory) we have considered the
> > > factor "Territory" as our random factor in the mixed models. The
> > > model
> > > definition is approximately Y = explanatory variables +
> > > (1|id  Territory),
> > > where Y is the occupation status (0/1) (See an example below).
> > >
> > > 4)     Our independent variables are both categorical (e.g. tree
> > > species;
> > > aspect: an angle recoded into 4 categories) and continuous
> > > (components
> > > resulting of a PCA on several original environmental variables,
> > > performed
> > > to reduce the number of original variables). For more details for
> > > each
> > > analysis:
> > >
> > >
> > > -Nest-tree scale: 2 continuous variables (FAC1TreeHeight,
> > > FAC2TreeWidth)
> > > and 1 four level categorical variable (TreeSpecies).
> > >
> > >
> > >
> > > -Nest-site forest scale: 4 continuous variables
> > > (FAC1BroadLeavedTrees,
> > > FAC2YoungPines, FAC3MaturePines, FAC4SlopeAndShrubs) and 1 four level
> > > categorical variable (ForestAspect).
> > >
> > >
> > >
> > > -Landscape scale: 3 continuous variables (FAC1PinusVSQuercus,
> > > FAC2HumanizedLand, FAC3DistanceToRoads).
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > One example of the script used to model would be:
> > >
> > >
> > >
> > > mod1 <-
> > > glmer(Occupation~FAC1Treeheight+FAC2TreeWidth+Sp+(1|Territory),
> > > family=binomial, data=trees)
> > >
> > >
> > >
> > >
> > >
> > > *The problem: *
> > >
> > >
> > >
> > > While creating the candidate models with glmer function to later
> > > select the
> > > best ones by their AICcs, we've faced some warnings telling that some
> > > of
> > > the models are failing to converge:
> > >
> > >
> > >
> > > In checkConv(attr(opt, "derivs"), opt$par, ctrl =
> > > control$checkConv,  :
> > >
> > >   Model failed to converge with max|grad| = 0.0483015 (tol = 0.001,
> > > component 1)
> > >
> > >
> > >
> > > It happens specially, although not always, with the models with more
> > > parameters and also with those containing categorical variables.
> > >
> > >
> > >
> > >
> > > *My question: *
> > >
> > >
> > >
> > > Given our variables, random factor and data is there any particular
> > > reason
> > > why our models could fail to converge? If so, is there a possible
> > > solution
> > > to the convergence problem?
> > >
> > >
> > >
> > >
> > >
> > > Thank you very much in advance. Waiting for your answer,
> > >
> > >
> > > Jordi Rosich
> > >
> > >       [[alternative HTML version deleted]]
> > >
> > > _______________________________________________
> > > R-sig-mixed-models at r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
*********************************************************

Antonio Hernandez Matias

Equip de Biologia de la Conservació
Departament de Biologia Evolutiva, Ecología i Ciències Ambientals
Facultat de Biologia  i Institut de Recerca de la Biodiversitat (IRBio)
Universitat de Barcelona (UB)
Av. Diagonal, 643
Barcelona      08028
Spain
Telephone: +34-934035857
FAX: +34-934035740
e-mail: ahernandezmatias at ub.edu

***********************************************************

	[[alternative HTML version deleted]]



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