Opened 7 years ago

Closed 6 years ago

#843 closed request (wontfix)

Binomial Confidence Interval

Reported by: Peter Owned by: Peter
Priority: minor Milestone:
Component: statistics Version:
Keywords: Cc:


Given n trials and k successes what is the confidence interval of the success rate, r?

For large n and k is not close to 0 or n, a gaussian approximation can be used.

Otherwise use the Clopper-Pearson method which says the CI is

gsl_cdf_beta_Pinv (alpha/2, n-k, n) : gsl_cdf_beta_Pinv (1-alpha/2, k+1, n)

In terms of interface, either functions taking k and n, or a class like the averager which one can add data to. In the latter case the estimated success rate (k/n) should be part of the interface as it is highly expected.

Change History (3)

comment:1 Changed 6 years ago by Peter

According to this site the modified Walt method is more accurate [than Clopper-Pearson] in most cases, so we'll go with that. It looks extremely easy to implement too.

comment:2 Changed 6 years ago by Peter

Status: newassigned

comment:3 Changed 6 years ago by Peter

Milestone: yat 0.14
Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.