[SciPy-Dev] Binomial proportion confidence interval

Christoph Deil deil.christoph at googlemail.com
Wed Apr 16 08:25:14 EDT 2014


On 16 Apr 2014, at 14:22, josef.pktd at gmail.com wrote:

> On Wed, Apr 16, 2014 at 8:16 AM, Christoph Sawade
> <christoph.sawade at googlemail.com> wrote:
>> Hi,
>> 
>> I would like to add approximate intervals [1] to the scipy project.
>> Approximate intervals often have higher statistical power than exact
>> intervals for binomial random variables.
>> Example usage can be found in the "binom R" package [2]. In analogy to [3],
>> I see two possible ways to integrate these methods into the scipy API:
>> 
>> (a,b) = scipy.stats.binom.approx_interval(alpha, loc, scale,
>> method='wilson')
>> (a,b) = scipy.stats.binom.wilson_interval(alpha, loc, scale),
>> 
>> where (a,b) are the end-points of range that contain 100*alpha % of the rv's
>> possible values.
>> 
>> What do you think?
> 
> I added them to statsmodels
> http://statsmodels.sourceforge.net/devel/generated/statsmodels.stats.proportion.proportion_confint.html
> together with other functions supporting proportions
> 
> http://statsmodels.sourceforge.net/devel/stats.html#proportion
> 
> Josef

I didn’t look in detail, but FYI there’s also these binomial stats methods in Astropy:
http://docs.astropy.org/en/latest/api/astropy.stats.binned_binom_proportion.html
http://docs.astropy.org/en/latest/api/astropy.stats.binom_conf_interval.html

Seems some people use those a lot, i.e. `scipy.stats` would be an appropriate place?

Christoph

> 
> 
>> 
>> Best, Christoph
>> 
>> [1] http://www-stat.wharton.upenn.edu/~tcai/paper/Binomial-StatSci.pdf
>> [2] http://cran.r-project.org/web/packages/binom/index.html
>> [3]
>> http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_discrete.interval.html#scipy.stats.rv_discrete.interval
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>> 
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140416/674de2d6/attachment.html>


More information about the SciPy-Dev mailing list