Java Generator for Poisson and Uniform Distributions?

According to my understanding, the standard generator is used for normal distribution I have to generate random numbers based on normal, uniform and Poisson distributions, but I can't seem to find the last class of 2

I have to generate them in the range of 0 – 999999

Solution

As David pointed out, the pseudorandom number generator provided uses uniform distribution

For the other two, I will use the CERN colt library function:

> Poisson > Normal/Gaussian

These library functions make it easy for you to find the random number obtained from each distribution instead of giving a probability density function or cumulative density function, and expect you to export the number yourself (this seems to be the Apache common math method):

RandomEngine engine = new DRand();
Poisson poisson = new Poisson(lambda,engine);
int poissonObs = poisson.nextInt();

Normal normal = new Normal(mean,variance,engine);
double normalObs = normal.nextDouble();

Also, please note that large λ Poisson distribution P( λ) By normal distribution n( λ, sqrt( λ)) Very close

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>