增加新版本lmer的迭代次数? [英] increase iterations for new version of lmer?

查看:167
本文介绍了增加新版本lmer的迭代次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将lme4更新为版本1.0-4,当我运行lmer()时,我的混合效果模型(之前收敛)现在会打印此警告:

I just updated lme4 to version 1.0-4 and when I run lmer() my mixed effects model, which was converging before, now prints this warning:

Warning message:
In (function (fn, par, lower = rep.int(-Inf, n), upper = rep.int(Inf,  :
  failure to converge in 10000 evaluations

所以,我想尝试增加迭代次数以查看是否我可以解决这个问题。(我必须说我不知道​​导致警告的是什么,因为消息的第一部分听起来有点不透明。)无论如何,我在文档中读到现在我应该使用 lmerControl (),但我无法实现它。有人能给我一个具体的例子说明你是如何做到具体的吗?(帮助文件没有帮助)。这是我的模型:

So, I'd like to try to increase the number of iterations to see if I can fix this. (I must say I have no idea what is causing the warning, as the first part of the message sounds a bit opaque). In any case, I read in the documentation that now I should use lmerControl(), but I haven't been able to implement it. Could someone give me a specific example of how you'd do it for concreteness? (the Help file doesn't help). Here is my model:

m <- lmer(RT ~ Factor1*Factor2 + (0+Factor1+Factor2|Subject) + (1|Subject)  + (1|Item) + (0+Factor1+Factor2|Item), data= data)

非常感谢!

推荐答案

lmerControl 功能允许您选择一个优化器并将控制参数传递给它。控制迭代次数或评估次数的参数因函数而异(如 lmerControl 的帮助页面中所述)。默认优化器是Nelder_Mead,对于该优化器选择,可以通过在'optCtrl'参数列表中指定maxfun来更改最大评估数:

The lmerControl function allows you to choose an optimizer and pass controls parameters to it. The parameters that control numbers of iterations or evaluations vary from function to function (as described in the help page for lmerControl). The default optimizer is "Nelder_Mead" and for that optimizer choice the maximum number of evaluations can be changed by specifying "maxfun" in the 'optCtrl' parameter list:

m <- lmer(RT ~ Factor1*Factor2 + (0+Factor1+Factor2|Subject) + 
               (1|Subject)  + (1|Item) + (0+Factor1+Factor2|Item),
          data= data, control=lmerControl(optCtrl=list(maxfun=20000) ) )

这不能保证达到收敛。 (我的经验是,默认最大值通常就足够了。)您的数据完全可能不足以支持模型的复杂性,或者模型的设计不正确。

This is not a guarantee that convergence will be reached. (My experience is that the default maximum is usually sufficient.) It's perfectly possible that your data is insufficient to support the complexity of the model or the model is incorrectly constructed for the design of the study.

这篇关于增加新版本lmer的迭代次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆