statsmodels.stats.rates.confint_poisson(count, exposure, method=
Confidence interval for a Poisson mean or rate
The function is vectorized for all methods except “midp-c”, which uses an iterative method to invert the hypothesis test function.
All current methods are central, that is the probability of each tail is smaller or equal to alpha / 2. The one-sided interval limits can be obtained by doubling alpha.
Observed count, number of events.
Currently this is total exposure time of the count variable. This will likely change.
Method to use for confidence interval This is required, there is currently no default method
Significance level, nominal coverage of the confidence interval is 1 - alpha.
- tuple (low, upp)
- tuple (low, upp)
Available methods are:
“exact-c” central confidence interval based on gamma distribution
“score” : based on score test, uses variance under null value
“wald” : based on wald test, uses variance base on estimated rate.
“waldccv” : based on wald test with 0.5 count added to variance computation. This does not use continuity correction for the center of the confidence interval.
“midp-c” : based on midp correction of central exact confidence interval. this uses numerical inversion of the test function. not vectorized.
“jeffreys” : based on Jeffreys’ prior. computed using gamma distribution
“sqrt” : based on square root transformed counts
“sqrt-a” based on Anscombe square root transformation of counts + 3/8.
“sqrt-centcc” will likely be dropped. anscombe with continuity corrected center. (Similar to R survival cipoisson, but without the 3/8 right shift of the confidence interval).
sqrt-cent is the same as sqrt-a, using a different computation, will be deleted.
sqrt-v is a corrected square root method attributed to vandenbrouke, which might also be deleted.
maybe split nobs and exposure (? needed in NB). Exposure could be used to standardize rate.
modified wald, switch method if count=0.
Barker, Lawrence. 2002. “A Comparison of Nine Confidence Intervals for a Poisson Parameter When the Expected Number of Events Is ≤ 5.” The American Statistician 56 (2): 85–89. https://doi.org/10.1198/000313002317572736.
Patil, VV, and HV Kulkarni. 2012. “Comparison of Confidence Intervals for the Poisson Mean: Some New Aspects.” REVSTAT–Statistical Journal 10(2): 211–27.