【问题标题】:Trouble with achieving convergence in nonlinear mixed-effects model in Pinhiero and Bates book在 Pinhiero 和 Bates 书中实现非线性混合效应模型收敛的问题
【发布时间】:2018-12-26 00:11:10
【问题描述】:

我正在阅读 Pinhiero 和 Bates 的书S 和 S-Plus 中的混合效果模型。我无法让第 8 章(第 387 页)中的模型收敛。

library(nlme)

fm1Wafer.nlmeR <- nlme(current ~ A + B * cos(4.5679 * voltage) + C * sin(4.5679 * voltage),
                       data = Wafer,
                       fixed = list(A ~ voltage + I(voltage^2), B + C ~ 1),
                       random = list(Wafer = A ~ voltage + I(voltage^2),
                                     Site = pdBlocked(list(A ~ 1, A ~ voltage + I(voltage^2)-1))),
                       start = c(-4.26, 5.62, 1.26, -0.10, 0.10), # starting values taken from fixed effects of another model earlier in the book
                       method = "REML",
                       control = nlmeControl(opt = "nlm"))

如您所见,我已经尝试了nlm 优化器。默认的nlminb 优化器也不起作用。两者都产生此错误消息

Error in nlme.formula(current ~ A + B * cos(4.5679 * voltage) + C * sin(4.5679 *  : 
  maximum number of iterations (maxIter = 50) reached without convergence
In addition: Warning messages:
1: In logLik.reStruct(object, conLin) :
  Singular precision matrix in level -2, block 1
2: In logLik.reStruct(object, conLin) :
  Singular precision matrix in level -2, block 1

有什么建议吗?本书下游有几个基于这个模型的模型,所以让它收敛会很好。

【问题讨论】:

    标签: r nlme


    【解决方案1】:

    该错误表明设置类似nlmeControl(opt = "nlm", maxIter = 2000) 会有所帮助,但实际上并没有。我尝试了 4000,但它需要永远......

    似乎真正的罪魁祸首是method = "REML"。保留默认的 "ML" 会得到预期的结果。

    fm1Wafer.nlmeR <- nlme(current ~ A + B * cos(4.5679 * voltage) + C * sin(4.5679 * voltage),
                           data = Wafer,
                           fixed = list(A ~ voltage + I(voltage^2), B + C ~ 1),
                           random = list(Wafer = A ~ voltage + I(voltage^2),
                                         Site = pdBlocked(list(A ~ 1, A ~ voltage + I(voltage^2) - 1))),
                           start = c(-4.26, 5.62, 1.26, -0.10, 0.10))
    

    【讨论】:

    • 谢谢@Julius Vainora。是的,我尝试了更多迭代,结果相同。将离开这本书并将其切换回完整的 ML。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-22
    • 2017-04-03
    • 2015-05-26
    • 1970-01-01
    • 2017-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多