[Scipy-tickets] [SciPy] #1881: Binomial and Bernoulli in scipy.stats.distributions do not accept probability 0 or 1

SciPy Trac scipy-tickets@scipy....
Fri Mar 29 10:33:17 CDT 2013


#1881: Binomial and Bernoulli in scipy.stats.distributions do not accept
probability 0 or 1
--------------------+-------------------------------------------------------
 Reporter:  Sytse   |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  0.11.0     
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by josefpktd):

 Question: If skew and kurtosis are requested, the answer is (inf, inf).
 Should we let the zero division warning go through to the user in this
 case or not?

 If not, return (inf, inf) if pr*(1-pr) == 0 without warning

 If yes, then we could calculate g1 and g3 only if skew and kurtosis "sk"
 are requested.

 This could be done by adding a "moments" keyword to binom._stats. The main
 method ``stats`` will check for it

 {{{
         signature = inspect.getargspec(self._stats.im_func)
         if (signature[2] is not None) or ('moments' in signature[0]):
             mu, mu2, g1, g2 = self._stats(*args,**{'moments':moments})
 }}}

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


More information about the Scipy-tickets mailing list