Programming With Models: Writing Statistical Algorithms for General Model Structures With NIMBLE

Programming With Models: Writing Statistical Algorithms for General Model Structures With NIMBLE
复制标题

DOI:
10.1080/10618600.2016.1172487
复制
发表时间:
2017-01-01
影响因子:
2.4
通讯作者:
Bodik, Rastislav
Bodik, Rastislav
中科院分区:
数学2区
文献类型:
--
作者:
de Valpine, Perry;Turek, Daniel;Bodik, Rastislav

文献摘要

被引文献

相似文献

我们描述了NIMBLE,一个用于在R中为一般模型结构编程统计算法的系统。NIMBLE旨在应对三个挑战:灵活的模型规范,可以使用不同模型的编程算法语言,以及高级可编程性和执行效率之间的平衡。对于模型规范,NIMBLE扩展了BUGS语言并创建了模型对象,这些对象可以操作变量,计算日志概率值,生成模拟,并查询变量之间的关系。对于算法编程,NIMBLE提供了使用两个评估阶段处理模型对象的函数。第一阶段允许将函数专门化到特定模型和/或节点,例如为特定节点块创建Metropolis-Hastings采样器。第二阶段允许使用第一阶段的结果重复执行计算。为了实现高效的第二阶段计算,NIMBLE通过C++编译模型和函数,使用线性代数的Eigen库,并为用户提供编译对象的接口。NIMBLE语言代表了嵌入在R中的可编译的领域特定语言(DSL)。本文提供了一个概述的设计和基本原理的NIMBLE沿着说明性的例子,包括重要性抽样,马尔可夫链蒙特卡罗(MCMC)和蒙特卡罗期望最大化(MCEM)。本文的补充材料可在网上查阅。
We describe NIMBLE, a system for programming statistical algorithms for general model structures within R. NIMBLE is designed to meet three challenges: flexible model specification, a language for programming algorithms that can use different models, and a balance between high-level programmability and execution efficiency. For model specification, NIMBLE extends the BUGS language and creates model objects, which can manipulate variables, calculate log probability values, generate simulations, and query the relationships among variables. For algorithm programming, NIMBLE provides functions that operate with model objects using two stages of evaluation. The first stage allows specialization of a function to a particular model and/or nodes, such as creating a Metropolis-Hastings sampler for a particular block of nodes. The second stage allows repeated execution of computations using the results of the first stage. To achieve efficient second-stage computation, NIMBLE compiles models and functions via C++, using the Eigen library for linear algebra, and provides the user with an interface to compiled objects. The NIMBLE language represents a compilable domain-specific language (DSL) embedded within R. This article provides an overview of the design and rationale for NIMBLE along with illustrative examples including importance sampling, Markov chain Monte Carlo (MCMC) and Monte Carlo expectation maximization (MCEM). Supplementary materials for this article are available online.