School of Aquatic and Fishery Sciences, University of Washington, Seattle, Washington, United States of America.
Departamento de Oceanografía, Universidad de Concepción, Concepción, Chile.
PLoS One. 2018 May 24;13(5):e0197954. doi: 10.1371/journal.pone.0197954. eCollection 2018.
Statistical inference is a widely-used, powerful tool for learning about natural processes in diverse fields. The statistical software platforms AD Model Builder (ADMB) and Template Model Builder (TMB) are particularly popular in the ecological literature, where they are typically used to perform frequentist inference of complex models. However, both lack capabilities for flexible and efficient Markov chain Monte Carlo (MCMC) integration. Recently, the no-U-turn sampler (NUTS) MCMC algorithm has gained popularity for Bayesian inference through the software Stan because it is efficient for high dimensional, complex hierarchical models. Here, we introduce the R packages adnuts and tmbstan, which provide NUTS sampling in parallel and interactive diagnostics with ShinyStan. The ADMB source code was modified to provide NUTS, while TMB models are linked directly into Stan. We describe the packages, provide case studies demonstrating their use, and contrast performance against Stan. For TMB models, we show how to test the accuracy of the Laplace approximation using NUTS. For complex models, the performance of ADMB and TMB was typically within +/- 50% the speed of Stan. In one TMB case study we found inaccuracies in the Laplace approximation, potentially leading to biased inference. adnuts provides a new method for estimating hierarchical ADMB models which previously were infeasible. TMB users can fit the same model in both frequentist and Bayesian paradigms, including using NUTS to test the validity of the Laplace approximation of the marginal likelihood for arbitrary subsets of parameters. These software developments extend the available statistical methods of the ADMB and TMB user base with no additional effort by the user.
统计推断是一种广泛使用的、强大的工具,可用于了解不同领域的自然过程。AD Model Builder(ADMB)和 Template Model Builder(TMB)统计软件平台在生态文献中特别受欢迎,它们通常用于进行复杂模型的频率推断。然而,这两者都缺乏灵活且高效的马尔可夫链蒙特卡罗(MCMC)整合能力。最近,无翻转抽样器(NUTS)MCMC 算法因其在软件 Stan 中进行贝叶斯推断的高效性而在生态文献中流行起来,因为它适用于高维、复杂的层次模型。在这里,我们引入了 R 包 adnuts 和 tmbstan,它们提供了 NUTS 抽样,并通过 ShinyStan 提供了交互式诊断。修改了 ADMB 的源代码以提供 NUTS,而 TMB 模型则直接链接到 Stan 中。我们描述了这些包,提供了演示其使用的案例研究,并与 Stan 进行了性能对比。对于 TMB 模型,我们展示了如何使用 NUTS 测试拉普拉斯逼近的准确性。对于复杂模型,ADMB 和 TMB 的性能通常在 Stan 速度的正负 50%范围内。在一个 TMB 案例研究中,我们发现了拉普拉斯逼近的不准确性,这可能导致有偏差的推断。adnuts 提供了一种新的方法来估计层次 ADMB 模型,这些模型以前是不可行的。TMB 用户可以在频率和贝叶斯范式中拟合相同的模型,包括使用 NUTS 来测试任意参数子集的边际似然的拉普拉斯逼近的有效性。这些软件的发展扩展了 ADMB 和 TMB 用户群的可用统计方法,而用户无需付出额外的努力。