[R-sig-ME] Mixed Models convergence problems, Jordi Rosich
Phillip Alday
Phillip.Alday at unisa.edu.au
Tue Nov 15 06:19:08 CET 2016
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
More information about the R-sig-mixed-models
mailing list