mvpa2.misc.stats.binomial_proportion_ci

mvpa2.misc.stats.binomial_proportion_ci(n, X, alpha=0.05, meth='jeffreys')

Compute the confidence interval for a set of Bernoulli trials

Most, if not all, implemented methods assume statistical independence of the Bernoulli trial outcomes. Computed confidence intervals may be invalid if this condition is violated.

This is a re-implementation of Matlab code originally written by Anderson Winkler and Tom Nichols.

Parameters:

n : int

Number of trials

X : int or array

Number of successful trials. This can be a 1D array.

alpha : float

Coverage of the confidence interval. For a 95% CI (default), use alpha = 0.05.

meth : {‘wald’, ‘wilson’, ‘agresti-coull’, ‘jeffreys’, ‘clopper-pearson’, ‘arc-sine’, ‘logit’, ‘anscombe’}

Interval estimation method.

Returns:

2-item array or 2D array

With the lower and upper bound for the confidence interval. If X was given as a vector with p items a 2xp array is returned.

References

[R22]Brown LD, Cai TT, DasGupta AA. Interval estimation for a binomial proportion. Statistical Science. 2001 16(2):101-133. http://brainder.org/2012/04/21/confidence-intervals-for-bernoulli-trials