An admissible exact confidence interval for the number of balls in an urn, which is the population number of a hypergeometric distribution. This function can be used to calculate the interval constructed method proposed by Wang (2015).
WhyperCI_N(x, n, M, conf.level, details = FALSE)
a list which contains i) the confidence interval for N and ii) the infimum coverage probability of the intervals.
integer representing the number of white balls in the drawn balls.
integer representing the number of balls we draw in the urn without replacement, i.e., the sample size.
the number of white balls in the urn.
the confidence level of confidence interval.
TRUE/FALSE, can be abbreviate. If choose FALSE, the confidence interval at the observed X will be returned. If choose TRUE, the confidence intervals for all sample points and the infimum coverage probability will be returned. Default is FALSE.
Suppose X~Hyper(M,N,n). When M and n are known, Wang (2015) construct an admissible confidence interval for N by uniformly shrinking the initial 1-alpha Clopper-Pearson type interval from 0 to min(M,n). This interval is admissible so that any proper sub-interval of it cannot assure the confidence coefficient. This means the interval cannot be shortened anymore.
Wang, W. (2015). Exact Optimal Confidence Intervals for Hypergeometric Parameters. "Journal of the American Statistical Association" 110 (512): 1491-1499.
WhyperCI_N(10,50,800,0.95,details=TRUE)
WhyperCI_N(50,50,800,0.95)
Run the code above in your browser using DataLab