[Numpy-discussion] bug in stats.binom? Or is it just me.
David Huard
david.huard at gmail.com
Tue Jul 11 21:36:09 CDT 2006
There probably is a bug because
stats.binom.ppf(.975, 100, .5) crashes the ipython shell.
win2k, P3, latest binary release.
David
2006/7/11, JJ <josh8912 at yahoo.com>:
>
> Am I using the wrong syntax for the binom.ppf command, or is there a bug?
>
> >>> stats.binom.ppf(.975,100,.5)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/lib64/python2.4/site-packages/scipy/stats/distributions.py",
> line
> 3590, in ppf
> insert(output,cond,self._ppf(*goodargs) + loc)
> File "/usr/lib64/python2.4/site-packages/numpy/lib/function_base.py",
> line
> 501, in insert
> return _insert(arr, mask, vals)
> TypeError: array cannot be safely cast to required type
> >>>
> -----------------
> The info pages for binom.ppf state that:
> binom.ppf(q,n,pr,loc=0)
> - percent point function (inverse of cdf --- percentiles)
> So I would expect binom.ppf to take three variables.
>
> I expected the function to return a number, such as is done in matlab:
> N = 100
> alpha = 0.05
> p1 = 0.30
> cutoff = binoinv(1-alpha, N, p1)
>
> cutoff =
>
> 38
> Any suggestions?
>
>
> JJ
>
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060711/ea9a5f38/attachment-0001.html
More information about the Numpy-discussion
mailing list