arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.13494cs.PLstat.CO
收藏

具有形式化保证的随机变量生成

Random Variate Generation with Formal Guarantees

Feras A. Saad, Wonyeol Lee

AI总结:

本文提出一种基于有限精度CDF的自动合成精确随机变量生成器的方法,达到Knuth-Yao最优熵率,在精度、熵效率和自动化上优于GNU Scientific Library。

摘要:

本文介绍了一种具有形式化保证的、有原则且实用的随机变量生成新方法。其核心思想是:首先以有限精度数值程序的形式指定所需的概率分布,该程序定义其累积分布函数(CDF),然后根据该CDF生成精确的随机变量。我们提出了一种通用且全自动的方法,能够在给定任何以任意二进制数格式(如浮点数、定点数和posit格式)实现的数值CDF时,合成精确的随机变量生成器。该方法保证以与指定CDF相同的精度运行,不会溢出,避免昂贵的任意精度算术,并提供一致的API。该方法基于一类生成器的新型时空最优实现,这类生成器达到信息论最优的Knuth和Yao熵率,即每个输出变量消耗尽可能少的输入随机比特。我们使用该方法在C语言中开发了一个随机变量生成库,并在多种“连续”和“离散”分布上进行了评估,结果表明其运行时间与最先进的GNU Scientific Library相比具有竞争力,同时提供更高的精度、熵效率和自动化程度。

英文摘要:

This article introduces a new approach to principled and practical random variate generation with formal guarantees. The key idea is to first specify the desired probability distribution in terms of a finite-precision numerical program that defines its cumulative distribution function (CDF), and then generate exact random variates according to this CDF. We present a universal and fully automated method to synthesize exact random variate generators given any numerical CDF implemented in any binary number format, such as floating-point, fixed-point, and posits. The method is guaranteed to operate with the same precision used to specify the CDF, does not overflow, avoids expensive arbitrary-precision arithmetic, and exposes a consistent API. The method rests on a novel space-time optimal implementation for the class of generators that attain the information-theoretically optimal Knuth and Yao entropy rate, consuming the least possible number of input random bits per output variate. We develop a random variate generation library using our method in C and evaluate it on a diverse set of ``continuous'' and ``discrete'' distributions, showing competitive runtime with the state-of-the-art GNU Scientific Library while delivering higher accuracy, entropy efficiency, and automation.

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

↑