Bayesian analysis methods often use some form of iterative simulation such as Monte Carlo computation. Models that involve discrete variables can sometime pose a challenge, either because the methods used do not support such variables (e.g. Hamiltonian Monte Carlo) or because the presence of such variables can slow down the computation. A common workaround is to marginalise the discrete variables out of the model. While it is reasonable to expect that such marginalisation would also lead to more time-efficient computations, to our knowledge this has not been demonstrated beyond a few specialised models. We explored the impact of marginalisation on the computational efficiency for a few simple statistical models. Specifically, we considered two- and three-component Gaussian mixture models, and also the Dawid-Skene model for categorical ratings. We explored each with two software implementations of Markov chain Monte Carlo techniques: JAGS and Stan. We directly compared marginalised and non-marginalised versions of the same model using the samplers on the same software. Our results show that marginalisation on its own does not necessarily boost performance. Nevertheless, the best performance was usually achieved with Stan, which requires marginalisation. We conclude that there is no simple answer to whether or not marginalisation is helpful. It is not necessarily the case that, when turned 'on', this technique can be assured to provide computational benefit independent of other factors, nor is it likely to be the model component that has the largest impact on computational efficiency.
翻译:Bayesian分析方法往往使用某种形式的迭代模拟,如蒙特卡洛计算。涉及离散变量的模式有时会构成挑战,因为使用的方法不支持这些变量(例如汉密尔顿·蒙特·蒙特卡洛),或者因为存在这种变量会放慢计算速度。共同的变通方法是将离散变量从模型中边缘化。虽然我们有理由期望这种边缘化还会导致更具有时间效率的计算,但从我们的知识来看,这并没有在少数专门模型之外得到证明。我们探讨了边缘化对少数简单统计模型计算效率的影响。具体地说,我们考虑了所使用的方法不支持这些变量(例如汉密尔顿·蒙特·蒙特卡洛),或者由于存在这种变量会减缓计算速度。一个共同的变通办法是将离散变量连锁的Monte Carlo技术(即JAGS和 Stan)从中排挤出来。我们直接比较同一模型的边际和非边际的版本是同一软件的样本因素。我们的结果表明,它本身的边缘化并不一定提高绩效。然而,最优的绩效通常由斯坦来完成,这需要边际化,我们无法保证这个方法的计算方法的效益是边际的。我们可以作出这样的解释。我们的结论。这个结论,它不会在边际化中可以使边际化成为边际分析。