This function evaluates the Poisson probability density function.
POIPR — Function value, the probability that a Poisson random variable takes a value equal to K. (Output)
K — Argument for which the Poisson probability density function is to be evaluated. (Input)
THETA — Mean of
the Poisson distribution. (Input)
THETA must be
positive.
Generic: POIPR (K, THETA)
Specific: The specific interface names are S_POIPR and D_POIPR.
Single: POIPR (K, THETA)
Double: The double precision name is DPOIPR.
The function POIPR evaluates the probability density function of a Poisson random variable with parameter THETA. THETA, which is the mean of the Poisson random variable, must be positive. The probability function (with θ = THETA) is
f(x) = e−θθk/k!, for k = 0, 1, 2,…
POIPR evaluates this function directly, taking logarithms and using the log gamma function.
Figure 11- 5 Poisson Probability Function
Informational error
Type Code
1 1 The input argument, K, is less than zero.
Suppose X is a Poisson random variable with θ = 10. In this example, we evaluate the probability function at 7.
USE UMACH_INT
USE POIPR_INT
IMPLICIT NONE
INTEGER K, NOUT
REAL PR, THETA
!
CALL UMACH (2, NOUT)
K = 7
THETA = 10.0
PR = POIPR(K,THETA)
WRITE (NOUT,99999) PR
99999 FORMAT (' The probability that X is equal to 7 is ', F6.4)
END
The probability that X is equal to 7 is 0.0901
PHONE: 713.784.3131 FAX:713.781.9260 |