Skip to content

Convergence Problems with glmer.nb model

5 messages · Thierry Onkelinx, Aoibheann Gaughran

#
On 25 April 2016 at 13:00, Aoibheann Gaughran <gaughra at tcd.ie> wrote:

            

  
    
#
Dear Aoibheann,

Two general suggestions on the design. 1) A random effect of field seems
relevant too. 2) Have the units of origarea in a relevant scale. You are
modelling the number of visits per unit of origarea. Then the number per
hectare seems more relevant to me than the number per square meter.

Then try the most simple Poisson model to see it that converge.
glmer(field_count
~ (1| animal) + (1|field) + offset(log(origarea)), family = poisson)

If that works, then you could try the negative binomial distribution or
adding an observation level random effect.

The mailing list strips most attachments. So you need to put them on a
website or post a dropbox or google drive link.

Best regards,


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-04-25 14:08 GMT+02:00 Aoibheann Gaughran <gaughra at tcd.ie>:

  
  
#
Hi Thierry,

Here is the dropbox link to the data -
https://www.dropbox.com/s/ne5d4zp2gncwylm/foraging%20subset.csv?dl=0

I had changed the field area units from meter square to hectures already,
so that *should *be okay.  There is one exceedingly large "field" which is
actually a large area of forestry. Perhaps this is throwing the scaling
off.

Can you confirm that this is how I specify the observation level random
effect:

dframe1$obs <- factor(seq(nrow(dframe1)))  #modified from
https://rpubs.com/bbolker/glmmchapter

which is included in the model as

+(1|obs)


I'll try your suggestions and see how I get on.

Many thanks,

Aoibheann

On 25 April 2016 at 13:40, Thierry Onkelinx <thierry.onkelinx at inbo.be>
wrote:

  
    
#
Dear Aoibheann,

The specification of the observation level random effect is correct.

Looking at your data, I would expect that the large range in area of the
fields is the culprit. They range from only 0.07 ha up to 37.12 ha. Note
that one visit in the smallest fields equals a density of 14.5 visits/ha
while one visit in the largest 0.027 visits/ha.

I recommend to split the large field into smaller chunks. Creating smaller
chunks would make variables like slope and aspect more meaningful. I doubt
that they are homogeneous over large areas.

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-04-25 15:44 GMT+02:00 Aoibheann Gaughran <gaughra at tcd.ie>:

  
  
3 days later
#
Hi Thierry,

Apologies in the delay in reverting, I have been out on fieldwork. I have
tried your suggestions, but unfortunately am still having convergence
issues.  The most simple Poisson model runs fine, so I tried a negative
binomial distribution but that produced about 12 convergence warnings.
There were 12 warnings (use warnings() to see them)

 > warnings()

Warning messages:

1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  ... :
  Model failed to converge with max|grad| = 0.0493534 (tol = 0.001, component 1)

2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  ... :
  Model failed to converge with max|grad| = 0.0627833 (tol = 0.001, component 1)

3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  ... :
  Model is nearly unidentifiable: very large eigenvalue - Rescale variables?

etc.


I reverted to the simple Poisson and added the OLR, which ran, but as soon
as I add any additional complexity/variables (apart from sex) it produces a
convergence warning.

Warning message:In checkConv(attr(opt, "derivs"), opt$par, ctrl =
control$checkConv,  :
  Model failed to converge with max|grad| = 0.0332321 (tol = 0.001, component 1)


I am not sure where to go from here. Any guidance would be much appreciated.

Kind regards,

Aoibheann
On 25 April 2016 at 14:44, Aoibheann Gaughran <gaughra at tcd.ie> wrote: