We present an exact Bayesian inference method for discrete statistical models, which can find exact solutions to many discrete inference problems, even with infinite support and continuous priors. To express such models, we introduce a probabilistic programming language that supports discrete and continuous sampling, discrete observations, affine functions, (stochastic) branching, and conditioning on events. Our key tool is probability generating functions: they provide a compact closed-form representation of distributions that are definable by programs, thus enabling the exact computation of posterior probabilities, expectation, variance, and higher moments. Our inference method is provably correct, fully automated and uses automatic differentiation (specifically, Taylor polynomials), but does not require computer algebra. Our experiments show that its performance on a range of real-world examples is competitive with approximate Monte Carlo methods, while avoiding approximation errors.
翻译:我们提出了一种针对离散统计模型的精确贝叶斯推断方法,能够解决许多离散推断问题的精确解,即使面对无限支撑域和连续先验分布的情况同样适用。为表达此类模型,我们引入了一种支持离散与连续采样、离散观测、仿射函数、(随机)分支以及事件条件化的概率编程语言。我们的核心工具是概率生成函数:它们为程序可定义的分布提供了紧凑的封闭形式表示,从而实现了后验概率、期望、方差及高阶矩的精确计算。提出的推断方法在理论上是可证明正确的,完全自动化,采用自动微分(具体为泰勒多项式)技术,但无需计算机代数系统支持。实验表明,该方法在一系列真实世界案例上的性能与近似蒙特卡洛方法相当,同时避免了近似误差。