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.
翻译:我们提出了一种针对离散统计模型的精确贝叶斯推断方法,该方法能够解决许多离散推断问题的精确解,即使面对无限支撑和连续先验分布。为了表达此类模型,我们引入了一种概率编程语言,支持离散和连续采样、离散观测、仿射函数、(随机)分支以及事件条件化。我们的关键工具是概率生成函数:它们以紧凑的闭式表示形式呈现程序可定义的分布,从而能够精确计算后验概率、期望、方差和高阶矩。我们的推断方法在理论上是可证明正确的,完全自动化,并采用自动微分(具体为泰勒多项式),但无需计算机代数系统。实验表明,该方法在多个真实世界示例上的性能与近似蒙特卡洛方法具有竞争力,同时避免了近似误差。