优质做网站价格,如何在家里做网站,wordpress增加友情链接,wordpress企业插件1 指数分布指数分布的概率密度函数#xff1a;ylamda*exp(-lamda*x)x0由此可以计算概率分布函数#xff1a;y1-exp(-lamda*x)x0y是 X首先#xff0c;把y当作是在(0#xff0c;1)区间的均匀分布的随机变量。然后#xff0c;求y1-exp(-lamda*x)的逆函数#xff0c…1 指数分布指数分布的概率密度函数ylamda*exp(-lamda*x)x0由此可以计算概率分布函数y1-exp(-lamda*x)x0y是 X首先把y当作是在(01)区间的均匀分布的随机变量。然后求y1-exp(-lamda*x)的逆函数x(1/lamda)*ln(1y)令z1y显然z也是(01)区间的均匀分布的随机变量于是就有x(1/lamda)*ln(z)。z可以通过(double)rand() / RAND_MAX计算。原因是rand() 是随机分布函数。最终满足指数分布的变量x就可以通过x(1/lamda)*ln(z)计算。importjava.util.*;public class zhishu{publicstatic void main(String[] args) {double x,z;doublelamda;System.out.println(请输入lamda的值);Scannerscanner new Scanner(System.in);lamda scanner.nextDouble();for(int i0;i10; i) {z Math.random();x -(1 /lamda) * Math.log(z);System.out.println(x);}}}----------------------------------------------------------------------2正态分布java.util.Random里的nextGaussian()生成的数值符合均值为0方差为1的高斯/正态分布即符合标准正态分布。产生数字的范围任何数都有可能不过在0左右的数字较多。产生N(a,b)的数Math.sqrt(b)*random.nextGaussian()a 即均值为a方差为b的随机数--------------------------------------------------------------------------------------3 扩展使用[01]之间的均匀分布生成任意一个分布函数的随机数序列任务给定一个分布的密度函数f(x)要生成满足这一分布的一组随机数。输入一组[0,1]之间的满足均匀分布的随机数U输出一组满足f(x)的随机数V方法1)求f(x)的分布函数F(x)2)求F(x)的反函数F(x)3)对于U中的每一个元素u将F(u)加入序列V中。4 其他colt库中有随机数发生器cern.jet.random.DistributionsMethod Summarystatic doublek,double p) Returnsthe probability distribution function of the discrete geometricdistribution.static doubler,int nr, RandomEngine randomGenerator) Returnsa random number from the Burr II, VII, VIII, X Distributions.static doubler,double k,int nr, RandomEngine randomGenerator) Returnsa random number from the Burr III, IV, V, VI, IX, XIIdistributions.static doubleReturnsa cauchy distributed random number from the standard Cauchydistribution C(0,1).static doublevariance,double mean, RandomEngine randomGenerator) Returnsan erlang distributed random number with the given variance andmean.static intp, RandomEngine randomGenerator) Returnsa discrete geometric distributed randomnumber;static doublel3,double l4, RandomEngine randomGenerator) Returnsa lambda distributed random number with parameters l3 and l4.static doubleReturnsa Laplace (Double Exponential) distributed random number from thestandard Laplace distribution L(0,1).static doubleReturnsa random number from the standard Logistic distributionLog(0,1).static doublealpha,double cut, RandomEngine randomGenerator) Returnsa power-law distributed random number with the given exponent andlower cutoff.static doubleReturnsa random number from the standard Triangular distribution in(-1,1).static doublealpha,double beta, RandomEngine randomGenerator) Returnsa weibull distributed random number.static intz, RandomEngine randomGenerator) Returnsa zipfian distributed random number with the given skew.