Speed up lmer function in R

后端 未结 3 1874
粉色の甜心
粉色の甜心 2021-02-01 07:32

I would like to share some of my thoughts when trying to improve the model fitting time of a linear mixed effects model in R using the lme4 package. <

3条回答
  •  耶瑟儿~
    2021-02-01 08:02

    If you use glmer rather than lmer, there is a parameter nAGQ. I found that setting nAGQ=0 dramatically reduced the time it took to fit a fairly complex model (13 fixed effects, one random effect with varying intercept and slope, 300k rows). This basically tells glmer to use a less exact form of parameter estimation for GLMMs. See ?glmer for more details, or this post.

提交回复
热议问题