【问题标题】:Understand warning messages for mixed model in r lme4了解 r lme4 中混合模型的警告消息
【发布时间】:2014-08-04 05:13:06
【问题描述】:

我在 lme4 包中为 r 建立并运行了一个混合效应逻辑回归模型,以估计不同位置(细胞/栖息地)中鱼类的占有率。数据框由 68 条个体鱼的 1,207,140 个观测值组成。对于每个人(每天约 1 年),它描述了每个唯一位置的出现次数相对于所有位置的出现总数。

这是基本模型:

    m.base = glmer(cbind(N,t.move-N) ~ jdate + snSurface.Area + Restoration..P.A. +    
    Release.Location+ Sex + (1|Station) + (0 + jdate|ID), data=allfishdat, family=binomial)
where N=# unique positions, t.move=total positions, jdate=julian date, Station=locations, ID=fish ID

我收到以下警告消息:

Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
                Model failed to converge with max|grad| = 3349.26 (tol = 0.001)
2: In if (resHess$code != 0) { :
 the condition has length > 1 and only the first element will be used
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
 Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
 - Rescale variables?

我进行了一些搜索,试图了解这些消息的含义及其对模型的影响,但还没有理解这些警告。

【问题讨论】:

标签: r lme4 mixed-models


【解决方案1】:

如果第一个问题与 R 需要经历更多迭代以达到收敛有关,那么下面的代码可能会有所帮助。将“20000”替换为对您的特定模型有意义的任何最大迭代次数。 (请注意,您的原始模型代码已在末尾进行了修改,以包含 'control = my.control'。)

my.control=lmerControl(optCtrl=list(maxfun=20000); my.control

m.base = glmer(cbind(N,t.move-N) ~ jdate + snSurface.Area + Restoration..P.A. +  Release.Location+ Sex + (1|Station) + (0 + jdate|ID), data=allfishdat, family=binomial, control = my.control)

使用以下命令查看当前的 lmeControls 也可能对您有用:

str(lmerControl())

此外,这个先前的答案可能对您有所帮助: increase iterations for new version of lmer?

【讨论】:

  • 我在这里没有看到任何关于迭代不足的警告证据。例如,library(lme4); fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, control=lmerControl(optCtrl=list(maxfun=5))) 明确指出“超出了函数评估的最大数量”,我在上面没有看到。
猜你喜欢
  • 2012-03-07
  • 1970-01-01
  • 1970-01-01
  • 2011-12-15
  • 1970-01-01
  • 1970-01-01
  • 2022-08-20
  • 2011-12-11
  • 1970-01-01
相关资源
最近更新 更多