[Scipy-tickets] [SciPy] #1895: stats binom at non-integer n

SciPy Trac scipy-tickets@scipy....
Tue Apr 23 11:00:10 CDT 2013


#1895: stats binom at non-integer n
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  rgommers   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.12.0     
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by josefpktd):

 I completely agree, but what should be done

  - just document it
  - round ``n``
  - check and return nans

 Nobody has ever complained about this, and I only found it because of a
 random check of the distribution.

 Maybe the case where we run over a large number of n doesn't show up very
 often (only in sample size calculations, and maybe estimation). So I guess
 the check would cost much.

 Floating point errors: what's the correct check? your BTW

 I think I can convince myself to returning nans.

 in R

 {{{
 > pbinom(3, 10.1, 0.5)
 [1] NaN
 > pbinom(3, 10., 0.5)
 [1] 0.171875
 > pbinom(3, 10.0000000001, 0.5)
 [1] 0.171875
 > pbinom(3, 10.000000001, 0.5)
 [1] 0.171875
 > pbinom(3, 10.00000001, 0.5)
 [1] 0.171875
 > pbinom(3, 10.0000001, 0.5)
 [1] 0.171875
 > pbinom(3, 10.000001, 0.5)
 [1] NaN
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1895#comment:4>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list