Um blog sobre nada

Um conjunto de inutilidades que podem vir a ser úteis

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:

 

clip_image001[6]

 

 

For example, lest say that the average is 9 cars and you want to know the probability that exactly 2 cars will pass:

λ =9

k=2

 

81 /2  * 0.000123   =  0.004998097

 

Or 0.5%

 

 

That same calculation can be can be achieved in R using the density dpois function:

 

dpois(2,9)

[1] 0.004998097

 

 

 

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):

 
ppois(3,9)
[1] 0.02122649

 

sum(dpois(0:3,9))
[1]0.02122649
 
 

Probability of having seventeen or more cars passing by your house:

ppois(16, lambda=9, lower=FALSE) #upper tail 
[1] 0.01110591
 

OR

 
1-ppois(16, lambda=9) #lower tail
[1] 0.01110591

 

 

 

To finalise, we can simulate how many cars will pass on the next 10 hours:

rpois(10,9)
[1]  9  9 11 15  7  8  8 13 11  9

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão / Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão / Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão / Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão / Alterar )

Connecting to %s

 
%d bloggers like this: