NAG Library Routine Document
G01BKF returns the lower tail, upper tail and point probabilities associated with a Poisson distribution.
||RLAMDA, PLEK, PGTK, PEQK
denote a random variable having a Poisson distribution with parameter
The mean and variance of the distribution are both equal to
G01BKF computes for given
The method is described in Knüsel (1986)
Knüsel L (1986) Computation of the chi-square and Poisson distribution SIAM J. Sci. Statist. Comput. 7 1022–1036
- 1: RLAMDA – REAL (KIND=nag_wp)Input
On entry: the parameter of the Poisson distribution.
- 2: K – INTEGERInput
On entry: the integer which defines the required probabilities.
- 3: PLEK – REAL (KIND=nag_wp)Output
On exit: the lower tail probability, .
- 4: PGTK – REAL (KIND=nag_wp)Output
On exit: the upper tail probability, .
- 5: PEQK – REAL (KIND=nag_wp)Output
On exit: the point probability, .
- 6: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
Results are correct to a relative accuracy of at least on machines with a precision of or more decimal digits, and to a relative accuracy of at least on machines of lower precision (provided that the results do not underflow to zero).
The time taken by G01BKF depends on and . For given , the time is greatest when , and is then approximately proportional to .
This example reads values of and from a data file until end-of-file is reached, and prints the corresponding probabilities.
9.1 Program Text
Program Text (g01bkfe.f90)
9.2 Program Data
Program Data (g01bkfe.d)
9.3 Program Results
Program Results (g01bkfe.r)