Lmer模型无法收敛


12

我的数据在这里描述当拟合重复测量方差分析时,什么会导致aov中的“ Error()模型为奇异误差”?

我试图使用来查看交互的效果,lmer所以我的基本情况是:

my_null.model <- lmer(value ~ Condition+Scenario+ 
                             (1|Player)+(1|Trial), data = my, REML=FALSE)

my.model <- lmer(value ~ Condition*Scenario+ 
                             (1|Player)+(1|Trial), data = my, REML=FALSE)

运行anova会给我带来显着的结果,但是当我尝试考虑随机斜率((1+Scenario|Player))时,模型将失败,并显示以下错误:

  Warning messages:
 1: In commonArgs(par, fn, control, environment()) :
   maxfun < 10 * length(par)^2 is not recommended.
 2: In optwrap(optimizer, devfun, getStart(start, rho$lower, rho$pp),  :
  convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded
 3: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
 4: In optwrap(optimizer, devfun, opt$par, lower = rho$lower, control = control,  :
   convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded
 5: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
   Model failed to converge with max|grad| = 36.9306 (tol = 0.002)
 6: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
   Model failed to converge: degenerate  Hessian with 1 negative eigenvalues

或者,如果它在多次迭代后仍无法收敛(我将其设置为100 000),并且在此之后得到了相同的结果50k100k这意味着它非常接近实际值,只是没有达到它。那么我可以这样报告我的结果吗?

请注意,当我将迭代次数设置得很高时,我只会收到以下警告:

 Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
 Model failed to converge with max|grad| = 43.4951 (tol = 0.002)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
 Model failed to converge: degenerate  Hessian with 1 negative eigenvalues

Answers:


8

这个谈话评估收敛的替代方法。具体来说,本·博克(Ben Bolker)的这一评论:

谢谢。甚至更简单的测试是举一个适合的示例,该示例向您提供收敛警告,并查看的结果,
relgrad <- with(fitted_model@optinfo$derivs,solve(Hessian,gradient))
max(abs(relgrad))
并查看其是否合理(例如,<0.001?)

另外,您可以在此处尝试Bolker的建议,即尝试使用其他优化程序。


1
如果max(abs(relgrad))为您提供2.9239489e-05的值,应该怎么办?
詹斯2015年

1
@Jens则将非常小(e-05的意思是“先写5个零,然后在左边看到数字”,第一个零后跟一个点)。因此,您会对此价值感到非常满意!
亚瑟·斯普恩
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.