The Poisson distribution
Posted by Diego em Setembro 24, 2015
The Poisson distribution is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time and/or space if these events occur with a known average rate and independently of the time since the last event.
Example: let’s say that you are interested in knowing the probability that X cars are going to pass in front your house in a given period of time.
To do that, you need to assume two things:
1) Any period of time is no different than any other period of time;
2) The number of cars that pass in one period doesn’t not affect the number of cars that will pass on the next period;
Give those assumptions, you need to find out how many cars on average pass in front of your house (that is your lambda – λ).
If you want know the probability that K cars will pass, all you have to do is substitute λ and k on the formula bellow:
For example, lest say that the average is 9 cars and you want to know the probability that exactly 2 cars will pass:
81 /2 * 0.000123 = 0.004998097
That same calculation can be can be achieved in R using the density dpois function:
To compute cumulative probabilities (for example, probability of 0 or 1 or 2 or 3 cars ), we can use the ppois function (which is the same as summing all individual probabilities with dpois):
Probability of having seventeen or more cars passing by your house:
ppois(16, lambda=9, lower=FALSE) #upper tail
1-ppois(16, lambda=9) #lower tail
To finalise, we can simulate how many cars will pass on the next 10 hours:
 9 9 11 15 7 8 8 13 11 9