Skip to main content
QUICK REVIEW

[论文解读] Fitting Linear Mixed-Effects Models Using lme4

Douglas M. Bates, Martin Mächler|arXiv (Cornell University)|Jun 23, 2014
Data Analysis with R参考文献 4被引用 2,577
一句话总结

本文介绍了R语言中的lme4包,用于使用最大似然估计或限制性最大似然(REML)估计拟合线性混合效应模型。它详细阐述了计算框架,包括模型构建、稀疏矩阵方法、Cholesky分解以及惩罚最小二乘优化,从而实现对具有随机效应的复杂分层数据的高效且灵活的分析。

ABSTRACT

(Uploaded by Plazi for the Bat Literature Project) Maximum likelihood or restricted maximum likelihood (REML) estimates of the parameters in linear mixed-effects models can be determined using the lmer function in the lme4 package for R. As for most model-fitting functions in R, the model is described in an lmer call by a formula, in this case including both fixed- and random-effects terms. The formula and data together determine a numerical representation of the model from which the profiled deviance or the profiled REML criterion can be evaluated as a function of some of the model parameters. The appropriate criterion is optimized, using one of the constrained optimization functions in R, to provide the parameter estimates. We describe the structure of the model, the steps in evaluating the profiled deviance or REML criterion, and the structure of classes or types that represents such a model. Sufficient detail is included to allow specialization of these structures by users who wish to write functions to fit specialized linear mixed models, such as models incorporating pedigrees or smoothing splines, that are not easily expressible in the formula language used by lmer.

研究动机与目标

  • 为在R中拟合线性混合效应模型提供一个稳健、高效且可扩展的框架。
  • 解决在中等规模数据集(10^4–10^6个观测值)上拟合混合模型时的计算挑战。
  • 通过模块化设计和可扩展性钩子,支持超越标准公式语法的灵活模型指定。
  • 在保持向后兼容性的同时,通过模块化架构和实验分支支持未来功能增强。
  • 记录并标准化线性混合模型的计算流程,同时支持终端用户和开发者。

提出的方法

  • 通过响应变量Y和随机效应B的联合分布来构建线性混合模型,给定B时条件服从正态分布。
  • 使用相对协方差因子Λθ来参数化随机效应的方差-协方差矩阵Σθ = σ²ΛθΛᵀθ。
  • 对Z和Λθ使用稀疏矩阵表示,以提高计算效率,尤其适用于大规模稀疏设计。
  • 应用Cholesky分解求解由轮廓REML或对数似然准则导出的惩罚最小二乘(PLS)问题。
  • 使用R中的约束优化例程优化轮廓准则,通过迭代精化进行参数估计。
  • 提供用于公式解析、准则评估、优化和模型推断的模块化函数,支持可扩展性和自定义。

实验结果

研究问题

  • RQ1如何利用现代稀疏矩阵技术在R中高效且灵活地实现线性混合效应模型?
  • RQ2哪些计算策略能够实现在具有复杂随机效应结构的大数据集上混合模型的可扩展估计?
  • RQ3lme4框架如何支持超越标准公式语法的模型,例如带有谱系或平滑样条的模型?
  • RQ4当前lme4中的PLS公式与Henderson的混合模型方程等早期方法之间有何关键差异?
  • RQ5该框架如何支持高级推断,包括轮廓似然、参数自 resampling 和后验预测模拟?

主要发现

  • lme4包成功实现了使用高效稀疏矩阵计算和基于Cholesky的PLS求解的线性混合效应模型的REML和ML估计。
  • 在睡眠剥夺研究示例中,固定效应估计为251.4毫秒(截距)和10.47毫秒/天(斜率),随机效应的标准差分别为24.74毫秒和5.92毫秒/天。
  • 轮廓似然图(zeta、密度和成对图)显示,随机效应参数的抽样分布近似正态分布,轮廓轨迹的非线性程度较低。
  • lme4的模块化设计支持可扩展性,gamm4和blme等包利用其钩子扩展了模型功能。
  • 该框架通过`fitted`、`predict`和`simulate`方法支持灵活的预测和模拟,可选择条件于随机效应或将其设为零。
  • 该实现稳定且可扩展,支持高达10^6个观测值的数据集,并成为Julia中MixedModels和lme4的flexLambda分支等相关工具的基础。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。