[Scipy-tickets] [SciPy] #1344: cdf of burr distribution is incorrect

SciPy Trac scipy-tickets@scipy....
Tue Dec 7 16:38:27 CST 2010


#1344: cdf of burr distribution is incorrect
-------------------------+--------------------------------------------------
 Reporter:  chairmanK    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  scipy.stats  |     Version:  0.8.0   
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by josefpktd):

  * component:  Other => scipy.stats


Comment:

 Why do you think it is incorrect? I don't see anything wrong.

 There is no guarantee that the private methods, _cdf, _pdf handle the
 bounds correctly, since they are handled by the public methods, cdf,
 pdf,...

 {{{
 >>> from scipy import stats
 >>> stats.burr.cdf(0, 0.5, 0.5)
 0.0
 >>> stats.burr._cdf(0, 0.5, 0.5)
 Traceback (most recent call last):
   File "<pyshell#41>", line 1, in <module>
     stats.burr._cdf(0, 0.5, 0.5)
   File "c:\josef\_progs\subversion\scipy-
 trunk_after\trunk\dist\scipy-0.9.0.dev6579.win32\programs\python25\lib
 \site-packages\scipy\stats\distributions.py", line 2086, in _cdf
     return (1+x**(-c*1.0))**(-d**1.0)
 ZeroDivisionError: 0.0 cannot be raised to a negative power

 >>> stats.burr._cdf(np.array(0), 0.5, 0.5)
 0.0

 >>> stats.burr._cdf(np.inf, 0.5, 0.5)
 1.0

 >>> stats.burr._cdf(1, 0.5, 0.5)
 0.70710678118654757
 >>> stats.burr.veccdf(1, 0.5, 0.5)
 array(0.70710678118794146)

 >>> stats.burr.a
 0.0
 >>> stats.burr.b
 1.#INF
 }}}

 Nevertheless, in many places, I was replacing python functions like power
 with numpy functions, since they are more robust in cases like this.

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


More information about the Scipy-tickets mailing list