Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding the Poisson distribution of a random number generator

I'm working with the random number generator available within C++11. At the moment, I'm using a uniform distribution, which should give me an equal probability to get any number within the range A & B which I specify.

However, I'm confused about generating Poisson distributions. While I understand how to determine the Poisson probability, I don't understand how a random series of numbers can be "distributed" based on the Poisson distribution.

For instance, the C++11 constructor for a Poisson distribution takes one argument -- λ, which is the mean of the distribution

std::tr1::poisson_distribution<double> poisson(7.0);
std::cout << poisson(eng) << std::endl;

In a Poisson probability problem, this is equal to the expected number of successes / occurrences during a given interval. However, I don't understand what it represents in this instance. What is a "success" / "occurrence" in a random number scenario?

I appreciate any assistance or reference materials which I can use to help me understand this.

like image 834
BSchlinker Avatar asked Feb 22 '12 09:02

BSchlinker


People also ask

How do you generate a random number in a Poisson distribution?

r = poissrnd( lambda ) generates random numbers from the Poisson distribution specified by the rate parameter lambda . lambda can be a scalar, vector, matrix, or multidimensional array.

How do you interpret Poisson distribution?

Revised on August 26, 2022. A Poisson distribution is a discrete probability distribution. It gives the probability of an event happening a certain number of times (k) within a given interval of time or space. The Poisson distribution has only one parameter, λ (lambda), which is the mean number of events.

How do you generate a random number in a Poisson distribution in R?

To generate numbers from a poisson distribution, use rpois(). The Poisson distribution is popular for modeling the number of times an event occurs in an interval of time or space.

How do you generate random timings for a Poisson process?

Simply choose a random point on the y-axis between 0 and 1, distributed uniformly, and locate the corresponding time value on the x-axis. For example, if we choose the point 0.2 from the top of the graph, the time until our next earthquake would be 64.38 minutes.


1 Answers

The probability of a Poisson distribution is the chance a specific value occurs. Imagine you want to calculate how many cars pass a certain point each day. This value will be more some days, but less on other days. But when keeping track of this over a serious amount of time, a mean will start to emerge, with values in its vicinity occurring more often, and values further away (0 cars per day or a tenfold amount) being less likely. λ is that mean that emerged.

When reflecting this to RNG's, the algorithm would return you the amount of cars that passed on a random day (which is selected uniformly). As you can imagine the mean value λ is more likely to emerge, and the extremes are least likely to pop up.

The following link has an example of the distribution Poisson has, showing the discrete results you acquire, and the chance each of them has of occurring:

http://www.mathworks.com/help/toolbox/stats/brn2ivz-127.html

A sample implementation could calculate for each value the probability it occurs, and then calculate ranges based on these values to translate a uniform distribution to Poisson. e.g. for λ == 2 we have 13% chance for 0, 27% chance for 1, 27% chance for 2... Then we generate a good old uniform random number between 0.0 and 1.0. If this number is <= 0.13 return 0. Is it <= 0.40 return 1. Is it <= 0.67 return 2 etc...

like image 139
oddstar Avatar answered Oct 31 '22 14:10

oddstar