PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_poisson (g01bk)
Purpose
nag_stat_prob_poisson (g01bk) returns the lower tail, upper tail and point probabilities associated with a Poisson distribution.
Syntax
Description
Let
denote a random variable having a Poisson distribution with parameter
. Then
The mean and variance of the distribution are both equal to
.
nag_stat_prob_poisson (g01bk) computes for given
and
the probabilities:
The method is described in
Knüsel (1986).
References
Knüsel L (1986) Computation of the chi-square and Poisson distribution SIAM J. Sci. Statist. Comput. 7 1022–1036
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
The parameter of the Poisson distribution.
Constraint:
.
- 2:
– int64int32nag_int scalar
-
The integer which defines the required probabilities.
Constraint:
.
Optional Input Parameters
None.
Output Parameters
- 1:
– double scalar
-
The lower tail probability, .
- 2:
– double scalar
-
The upper tail probability, .
- 3:
– double scalar
-
The point probability, .
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
-
-
-
-
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
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).
Further Comments
The time taken by nag_stat_prob_poisson (g01bk) depends on and . For given , the time is greatest when , and is then approximately proportional to .
Example
This example reads values of and from a data file until end-of-file is reached, and prints the corresponding probabilities.
Open in the MATLAB editor:
g01bk_example
function g01bk_example
fprintf('g01bk example results\n\n');
rlamda = [0.75 9.2 34 175];
k = int64([3 12 25 175]);
fprintf(' rlamda k plek pgtk peqk\n');
for i=1:4
[plek, pgtk, peqk, ifail] = ...
g01bk(rlamda(i), k(i));
fprintf('%8.3f%6d%10.5f%10.5f%10.5f\n', rlamda(i), k(i), plek, pgtk, peqk);
end
g01bk example results
rlamda k plek pgtk peqk
0.750 3 0.99271 0.00729 0.03321
9.200 12 0.86074 0.13926 0.07755
34.000 25 0.06736 0.93264 0.02140
175.000 175 0.52009 0.47991 0.03014
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015