摘要
本文给出任意单变量离散或连续分布抽样的通用算法与程序.对于离散分布,将根据其分布率从三个算法(逆变换、罐子法和别名法)中自动选出最合适的一个.在连续分布场合,使用如下的复合抽样方法:f(x)=pafa(x)+(1-pa)fb(x),式中fa(x)是密度f(x)的近似,并有fa(x)=L(x)/pa,而L(x)(≤f(x))是阶梯函数,其面积pa→1.在连续分布抽样中,也借助罐子法、别名法和近似的舍选法,且阶梯函数中的阶梯数目和非等距的阶梯划分等都由程序根据f(x)的特性自动确定.多于20个分布的数值试验表明,我们的通用算法很有效,可与为某些特定分布专门设计的最佳算法媲美.
The algorithms and programs for general purpose are provided for sampling from any discrete or continuous distribution with single variable. For the discrete distribution, one of three algorithms (inverse transform, Urn and Alias) is selected automatically based on the mass peculiarity. In case of continuous distribution, the composition method is used for sampling as follows: f(x) = pafa(x) + (1 - pa)fb(x), where fa(x) is an approximation of f(x), and fa(x) = L(x)/pa, L(x) (≤ f(x)) is a step function and its area pa → 1. In sampling, the urn, alias and approximate acceptance-rejection methods are used, respectively, and the number of steps in step function and non-equispaced steps are determined automatically by the program based on f(x) peculiarity. The numerical experiment of more than 20 distributions showed that our general purpose algorithm is efficient as the best algorithm for some particular distribution only.
出处
《数值计算与计算机应用》
CSCD
2006年第3期191-200,共10页
Journal on Numerical Methods and Computer Applications
关键词
蒙特卡洛方法
随机数发生器
随机变量抽样
任意分布
统计模拟
Monte Carlo method, random number generator, sampling from random variable, arbitrary distribution, statistical simulation