poissonCdf¶
Evaluates the Poisson distribution function.
Synopsis¶
poissonCdf (k, theta)
Required Arguments¶
- int
k
(Input) - Argument for which the Poisson distribution function is to be evaluated.
- float
theta
(Input) - Mean of the Poisson distribution. Argument
theta
must be positive.
Return Value¶
The probability that a Poisson random variable takes a value less than or equal to k.
Description¶
The function poissonCdf
evaluates the distribution function of a Poisson
random variable with parameter theta
. The mean of the Poisson random
variable, theta
, must be positive. The probability function (with θ =
theta
) is
\[f(x) = e^{-q} θ^x/x!, for x = 0, 1, 2, …\]
The individual terms are calculated from the tails of the distribution to
the mode of the distribution and summed. The function poissonCdf
uses
the recursive relationship
\[f(x + 1) = f(x)q/(x + 1), for x = 0, 1, 2, …, k - 1\]
with \(f(0)=e^{-q}\).
Figure 9.24 — Plot of \(F_p(k,\theta)\)
Example¶
Suppose X is a Poisson random variable with \(\theta=10\). This example evaluates the probability that \(X\leq 7\).
from __future__ import print_function
from numpy import *
from pyimsl.math.poissonCdf import poissonCdf
k = 7
theta = 10.0
p = poissonCdf(k, theta)
print("Pr(x <= 7) = %6.4f" % (p))
Output¶
Pr(x <= 7) = 0.2202
Informational Errors¶
IMSL_LESS_THAN_ZERO |
The input argument, k, is less than zero. |