It is often the case in Statistics that one needs to compute sums of infinite series, especially in marginalising over discrete latent variables. This has become more relevant with the popularization of gradient-based techniques (e.g. Hamiltonian Monte Carlo) in the Bayesian inference context, for which discrete latent variables are hard or impossible to deal with. For many commonly used infinite series, custom algorithms have been developed which exploit specific features of each problem. General techniques, suitable for a large class of problems with limited input from the user are less established. We employ basic results from the theory of infinite series to investigate general, problem-agnostic algorithms to truncate infinite sums within an arbitrary tolerance $\varepsilon > 0$ and provide robust computational implementations with provable guarantees. We compare three tentative solutions to estimating the infinite sum of interest: (i) a "naive" approach that sums terms until the terms are below the threshold $\varepsilon$; (ii) a `bounding pair' strategy based on trapping the true value between two partial sums; and (iii) a `batch' strategy that computes the partial sums in regular intervals and stops when their difference is less than $\varepsilon$. We show under which conditions each strategy guarantees the truncated sum is within the required tolerance and compare the error achieved by each approach, as well as the number of function evaluations necessary for each one. A detailed discussion of numerical issues in practical implementations is also provided. The paper provides some theoretical discussion of a variety of statistical applications, including raw and factorial moments and count models with observation error. Finally, detailed illustrations in the form noisy MCMC for Bayesian inference and maximum marginal likelihood estimation are presented.
翻译:在统计中,人们往往需要计算无限系列的总和,特别是在分散的潜伏变量的边际化方面。这在贝叶斯推论背景下,随着基于梯度的技术(例如汉密尔顿·蒙特·蒙特卡洛)的普及(例如汉密尔顿·蒙特·卡洛),在贝叶斯推论中,离散的潜伏变量很难或不可能处理。对于许多常用的无限序列,已经开发了利用每个问题的具体特点的定制算法。一般技术,适用于用户投入有限的大量问题,但相对较少建立。我们使用无限系列理论的基本结果来调查一般的、问题知觉的算法,在任意容忍 $\varepsil > 0美元范围内将无限数额应用到无限数额。我们比较了三种初步解决办法来估计无限利息总额:(一)“惯性”方法,在术语低于门槛值之前计算;(二)基于将真实值隐藏在两个部分数值之间的直径直径的直径直估,我们使用“直径直对一对一对一对一对一”策略,而在每次战略范围内进行定期分析时,“直观的直判判,在每一节算中,每个直判的直判时,每个直判的直判算中,每个直判的直判的直判的直判法,每个算法是算算算算算算算算算出一个比一个“平数数,每个平,每个平平,每个平,每个平,每个平的直数是比是比的直数,每个平数法,每个直判算法,每个直,每个直算法,每个算一个直算算算算算法,每个直算法,每个直。