naginterfaces.library.univar.ci_poisson¶
- naginterfaces.library.univar.ci_poisson(n, xmean, clevel)[source]¶
ci_poisson
computes a confidence interval for the mean parameter of the Poisson distribution.For full information please refer to the NAG Library document for g07ab
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g07/g07abf.html
- Parameters
- nint
, the sample size.
- xmeanfloat
The sample mean, .
- clevelfloat
The confidence level, , for two-sided interval estimate. For example gives a confidence interval.
- Returns
- tlfloat
The lower limit, , of the confidence interval.
- tufloat
The upper limit, , of the confidence interval.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
When using the relationship with the gamma distribution the series to calculate the gamma probabilities has failed to converge.
- Notes
Given a random sample of size , denoted by , from a Poisson distribution with probability function
the point estimate, , for is the sample mean, .
Given and this function 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
where .
The relationship between the Poisson distribution and the -distribution (see page 112 of Hastings and Peacock (1975)) is used to derive the equations
where is the deviate associated with the lower tail probability of the -distribution with 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;
where is the deviate associated with the lower tail probability, , of the gamma distribution with shape parameter and scale parameter . These deviates are computed using
stat.inv_cdf_gamma
.
- References
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