For a given mean, m, I have computed individual Poisson probabilities three ways.
1. Using the SAS POISSON function. This is cumulative, so P(m,n) = POISSON(m,n) - POISSON(m,(n-1))
2. Using the formula P(m,n) = exp(-m) * (m**n) / (n!)
In SAS, this is computed as: EXP(-m) * (m**n) / FACT(n)
3. Using the recursive formula: P(m,0) = exp(-m) and P(m,n) = P(m,(n-1)) * (m / n)
Using m = 5 and computing up to n = 30, I have found bigger differences between the methods than I would like to see. Methods 2 and 3 agree all the way to n = 30, but Method 1, using the SAS POISSON function, starts to diverge at n = 26.
CAN ANYONE PLEASE TELL ME WHICH METHOD IS THE MOST ACCURATE?
18 %let poimean = 5 ;
21 %let uplim = 30 ;
37 * method 2 ;
38 data _null_ ;
39 expm = exp(-&poimean.) ;
40 put expm= ;
41 do n = 0 to &uplim. ;
42 poi_n = expm * (&poimean.**n) / fact(n) ;
43 put n= poi_n= ;
44 end ;
45 run ;
I think the problem is n! .when n greater than 26 n! will be very very large to out the range of sas 's exact integer.Normally due to big n ,we will use Scott Formula
to approach n! .That is the reason why method 1 is different from 2 3.
In my opinion,Recommend to use method 1.
I am not quit sure my answer is right,it is just my opinion.