2014-06-13 50 views
5

我已經在lme4軟件包中構建並運行了一個混合效應邏輯迴歸模型,用於評估不同位置(細胞/棲息地)中魚類佔用的概率。數據框架包括687條魚的1,207,140條觀察數據。對於每個人(每天約1年),它描述了每個獨特位置相對於所有位置的總髮生次數的發生次數。瞭解rlme4中混合模型的警告消息

這是基礎型號:

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? 

我做了一些搜索,試圖瞭解這些信息的含義及其對模型的影響,但尚未理解警告。

+2

你可以說你已經看了什麼的已經和你做什麼和不理解?你有沒有讀過https://github.com/lme4/lme4/blob/master/README.md? http://stackoverflow.com/questions/23814130/glmer-model-from-early-2013-warning-message-about-convergence-when-re-running-i/23839952#23839952? http://stackoverflow.com/questions/21344555/convergence-error-for-development-version-of-lme4? –

+0

凹凸。這將有助於,如果你可以說你有什麼,並沒有明白 - 我很樂意幫助,但不想重複已經存在的信息... –

+0

凹凸碰撞..... –

回答

2

如果第一個問題與R需要通過更多迭代達到收斂有關,則下面的代碼可能會有所幫助。用任何最大迭代次數對您的特定模型有意義替換'20000'。 (請注意,您的原始模型代碼已經在最後被修改爲包括「控制= 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?

+4

我不'沒有看到任何關於這裏的迭代不足的警告。例如,'library(lme4); fm1 < - lmer(Reaction〜Days +(Days | Subject),sleepstudy,control = lmerControl(optCtrl = list(maxfun = 5)))'清楚地說明了「超出最大功能評估次數」 。 –