arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1602.02539stat.COstat.ME
收藏

另一种Gibbs加法建模器:JAGS和mgcv的接口

Just Another Gibbs Additive Modeller: Interfacing JAGS and mgcv

Simon N Wood

摘要:

BUGS语言为吉布斯抽样提供了一种非常灵活的方式来指定复杂的统计模型,而其JAGS变体通过rjags包提供了非常方便的R集成。然而,在JAGS模型中包括平滑器可能涉及一些相当繁琐的编码,特别是对于多变量或自适应平滑器。此外,如果需要附加平滑结构,则需要一些注意,以便适当地居中平滑,并找到适当的起始值。R包mgcv实现了各种平滑器,所有这些都以适合包含在JAGS代码中的方式实现,并自动执行居中和其他平滑设置任务。本说明的目的是描述mgcv和JAGS之间的接口,该接口基于R函数“jagam”,该函数采用mgcv中指定的广义可加模型(GAM),并自动生成JAGS模型代码和通过吉布斯抽样推断模型所需的数据。尽管自动生成的JAGS代码可以按原样运行,但用户希望修改它,以便添加JAGS中容易指定的复杂随机模型组件。还提供了一个简单的界面,用于可视化和进一步推断使用标准mgcv功能估计的平滑分量。如果所需的全部是关于标准GAM的完全贝叶斯推断,而不是JAGS的完全灵活性,则这里描述的方法将不一定是低效的。在这种情况下,BayesX包将更有效。

英文摘要:

The BUGS language offers a very flexible way of specifying complex statistical models for the purposes of Gibbs sampling, while its JAGS variant offers very convenient R integration via the rjags package. However, including smoothers in JAGS models can involve some quite tedious coding, especially for multivariate or adaptive smoothers. Further, if an additive smooth structure is required then some care is needed, in order to centre smooths appropriately, and to find appropriate starting values. R package mgcv implements a wide range of smoothers, all in a manner appropriate for inclusion in JAGS code, and automates centring and other smooth setup tasks. The purpose of this note is to describe an interface between mgcv and JAGS, based around an R function, `jagam', which takes a generalized additive model (GAM) as specified in mgcv and automatically generates the JAGS model code and data required for inference about the model via Gibbs sampling. Although the auto-generated JAGS code can be run as is, the expectation is that the user would wish to modify it in order to add complex stochastic model components readily specified in JAGS. A simple interface is also provided for visualisation and further inference about the estimated smooth components using standard mgcv functionality. The methods described here will be un-necessarily inefficient if all that is required is fully Bayesian inference about a standard GAM, rather than the full flexibility of JAGS. In that case the BayesX package would be more efficient.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑