POIPR

This function evaluates the Poisson probability density function.

Function Return Value

POIPR — Function value, the probability that a Poisson random variable takes a value equal to K. (Output)

Required Arguments

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.

FORTRAN 90 Interface

Generic: POIPR (K, THETA)

Specific: The specific interface names are S_POIPR and D_POIPR.

FORTRAN 77 Interface

Single: POIPR (K, THETA)

Double: The double precision name is DPOIPR.

Description

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 1,  Poisson Probability Density Function

Comments

Informational Error

 

Type

Code

Description

1

1

The input argument, K, is less than zero.

Example

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

Output

 

The probability that X is equal to 7 is 0.0901