Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server POISSON.DIST function


Updated: 31 July 2015

Use POISSON_DIST to calculate the probability mass function or the lower cumulative probability of a Poisson distribution for a given number of events occurring in a fixed interval given the rate.
  <@X, float,>
 ,<@Mean, float,>
 ,<@Cumulative, bit,>)
the number of events. @X must be of a type float or of type that intrinsically converts to float
the rate at which events occur during the interval. @Mean must be of a type float or of a type that intrinsically converts to float.
A bit value indicating whether the probability density function ('False') or the cumulative distribution function ('True') should be returned.
Return Type
·         @X is truncated and the integer value is used.
·         0 < @X
·         0 < @Mean
A phone support center averages 43 calls per hour. In this example we calculate the likelihood that it will receive exactly 47 calls in an hour.
               47           --@X
              ,43           --@Mean
              ,'False'      --@Cumulative
              ) as pmf

This produces the following result

If we wanted to know the likelihood that it would receive up to 47 calls in an hour, we would use the left-tailed cumulative probability.
               47                  --@X
              ,43                  --@Mean
              ,'True'              --@Cumulative
              ) as cdf

This produces the following result.

Since the Poisson distribution is a discrete distribution the cumulative distribution function, in this case, is the sum of the probabilities for each value from 0 to 47. We can use the XLeratorDB SeriesInt table-valued function to generate all the integer values from 0 to 47.
SELECT SUM(wct.POISSON_DIST(SeriesValue,43,'False')) as cdf
FROM wct.SeriesInt(0,47,NULL,NULL,NULL)

This produces the following result

The Poisson distribution is a special case of the gamma distribution
        wct.POISSON_DIST(x,lambda,'True') as POISSON_DIST
       ,wct.GAMMAQ(x+1,lambda) as GAMMAQ
FROM (VALUES (5,3))n(x,lambda)

This produces the following result.


See Also


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service