随机泊松噪声

500*_*500 2 wolfram-mathematica poisson

我在Mathematica中寻找相同的Matlab函数:

"R = poissrnd(lambda)从泊松分布中生成随机数,平均参数为lambda.lambda可以是向量,矩阵或多维数组.R的大小是lambda的大小."

下面的函数输出示例.

b = 95.7165   95.7165   95.7165   95.7165   95.7165   98.9772   98.9772   98.9772   98.9772    0.3876

poissrnd(b)

ans =100   115     81    90   109   106   104    87   104     2
Run Code Online (Sandbox Code Playgroud)

我怎样才能在Mathematica 8中做类似的事情?

abc*_*bcd 8

泊松分布仅被定义为整数.因此,您需要将RandomIntegerPoissonDistribution 一起使用,如下所示:

poissrnd[lambda_]:=RandomInteger[PoissonDistribution[lambda]]
Run Code Online (Sandbox Code Playgroud)

用法:

b = {95.7165, 95.7165, 95.7165, 95.7165, 95.7165, 98.9772, 98.9772, 
  98.9772, 98.9772, 0.3876};

poissrnd /@ b

Out[1] = {104, 97, 67, 84, 96, 123, 93, 96, 100, 0}
Run Code Online (Sandbox Code Playgroud)