NAG Library Routine Document
G07ABF computes a confidence interval for the mean parameter of the Poisson distribution.
||XMEAN, CLEVEL, TL, TU
Given a random sample of size
, denoted by
, from a Poisson distribution with probability function
the point estimate,
is the sample mean,
Given and this routine computes a confidence interval for the parameter , denoted by , where is in the interval .
The lower and upper confidence limits are estimated by the solutions to the equations
The relationship between the Poisson distribution and the
-distribution (see page 112 of Hastings and Peacock (1975)
) is used to derive the equations
is the deviate associated with the lower tail probability
degrees of freedom.
In turn the relationship between the
-distribution and the gamma distribution (see page 70 of Hastings and Peacock (1975)
) yields the following equivalent equations;
is the deviate associated with the lower tail probability,
, of the gamma distribution with shape parameter
and scale parameter
. These deviates are computed using G01FFF
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Snedecor G W and Cochran W G (1967) Statistical Methods Iowa State University Press
- 1: N – INTEGERInput
On entry: , the sample size.
- 2: XMEAN – REAL (KIND=nag_wp)Input
On entry: the sample mean, .
- 3: CLEVEL – REAL (KIND=nag_wp)Input
On entry: the confidence level, , for two-sided interval estimate. For example gives a confidence interval.
- 4: TL – REAL (KIND=nag_wp)Output
On exit: the lower limit, , of the confidence interval.
- 5: TU – REAL (KIND=nag_wp)Output
On exit: the upper limit, , of the confidence interval.
- 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:
When using the relationship with the gamma distribution to calculate one of the confidence limits, the series to calculate the gamma probabilities has failed to converge. Both TL
are set to zero. This is a very unlikely error exit and if it occurs please contact NAG
For most cases the results should have a relative accuracy of
is the machine precision
). Thus on machines with sufficiently high precision the results should be accurate to
significant digits. Some accuracy may be lost when
is very close to
, which will occur if CLEVEL
is very close to
. This should not affect the usual confidence intervals used.
The following example reads in data showing the number of noxious weed seeds and the frequency with which that number occurred in
sub-samples of meadow grass. The data is taken from page 224 of Snedecor and Cochran (1967)
. The sample mean is computed as the point estimate of the Poisson parameter
. G07ABF is then called to compute both a 95% and a 99% confidence interval for the parameter
9.1 Program Text
Program Text (g07abfe.f90)
9.2 Program Data
Program Data (g07abfe.d)
9.3 Program Results
Program Results (g07abfe.r)