arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1403.6870cs.MS
收藏

生成指数分布和正态分布伪随机数的一种改进的Ziggurat算法

A modified ziggurat algorithm for generating exponentially- and normally-distributed pseudorandom numbers

Christopher D McFarland

摘要:

Ziggurat算法是一种非常快速的拒绝采样方法,用于从常见的统计分布生成伪随机数(PRN)。该算法将分布划分为矩形层,这些矩形层彼此堆叠(类似于Ziggurat),包含所需的分布。然后通过拒绝对这些矩形层内的随机值进行采样。这种实现将层分为两种类型:那些构成完全落入分布之下的大多数并且可以在不进行拒绝测试的情况下非常快速地采样的层,以及一些封装分布边缘并需要拒绝测试的附加层。与这些生成器的最佳可用C实现相比,这种方法为指数分布PRN提供了65%的加速比,为正态分布PRN提供了82%的加速比。当该算法扩展到Python和MATLAB/OCTAVE编程环境时,可以获得更大的加速比。

英文摘要:

The Ziggurat Algorithm is a very fast rejection sampling method for generating PseudoRandom Numbers (PRNs) from common statistical distributions. The algorithm divides a distribution into rectangular layers that stack on top of each other (resembling a Ziggurat), subsuming the desired distribution. Random values within these rectangular layers are then sampled by rejection. This implementation splits layers into two types: those constituting the majority that fall completely under the distribution and can be sampled extremely fast without a rejection test, and a few additional layers that encapsulate the fringe of the distribution and require a rejection test. This method offers speedups of 65% for exponentially- and 82% for normally-distributed PRNs when compared to the best available C implementations of these generators. Even greater speedups are obtained when the algorithm is extended to the Python and MATLAB/OCTAVE programming environments.

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

↑