[Scipy-tickets] [SciPy] #745: scipy.stats.distribution - tests and bugfixes

SciPy scipy-tickets@scipy....
Fri Oct 3 09:30:39 CDT 2008


#745: scipy.stats.distribution - tests and bugfixes
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |        Owner:  somebody
     Type:  defect       |       Status:  new     
 Priority:  normal       |    Milestone:          
Component:  scipy.stats  |      Version:  devel   
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by josefpktd):

 one more error:
 _munp did not send the *args to the generic_moment calculations:

 in rv_discrete, line 3571 in my file:

 {{{
     def _munp(self, n, *args):
         return self.generic_moment(n, *args)  #JP new: missing *args
 }}}

 I also removed (comment out or rename) dlaplace_gen._stats because it has
 a incorrect variance calculation, and I don't have a reference for it. The
 generic moment calculation for dlaplace works, and is the same (up to
 sampling and approximation error) as the sample var of a random sample and
 the direct calulation using pmf. (does not look as nice: mean is
 -5.935310377088359e-017 instead of 0.0)

 Now I'm down to one error in the basic test of the discrete distributions.
 I also added trac tickets with - what I think are - the corrections to the
 numpy.random bugs in logser and hypergeom.

 Josef

 {{{
 >python test_discrete_basic.py
 ................................................................................
 .................................................F..
 ======================================================================
 FAIL: __main__.test_discrete_private(<scipy.stats.distributions.zipf_gen
 instanc
 e at 0x029E6760>, (4,), 1.5198177546350669, 2, 3)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "c:\programs\python25\lib\site-
 packages\nose-0.10.3-py2.5.egg\nose\case.p
 y", line 182, in runTest
     self.test(*self.arg)
   File "test_discrete_basic.py", line 101, in check_generic_moment
     err_msg= str(distfn) + ' generic moment test')
   File "C:\Programs\Python25\Lib\site-packages\numpy\testing\utils.py",
 line 208
 , in assert_almost_equal
     return assert_array_almost_equal(actual, desired, decimal, err_msg)
   File "C:\Programs\Python25\Lib\site-packages\numpy\testing\utils.py",
 line 311
 , in assert_array_almost_equal
     header='Arrays are not almost equal')
   File "C:\Programs\Python25\Lib\site-packages\numpy\testing\utils.py",
 line 296
 , in assert_array_compare
     raise AssertionError(msg)
 AssertionError:
 Arrays are not almost equal
 <scipy.stats.distributions.zipf_gen instance at 0x029E6760> generic moment
 test
 (mismatch 100.0%)
  x: array(1.3733362995515972)
  y: array(1.5198177546350669)

 ----------------------------------------------------------------------
 Ran 132 tests in 9.140s

 FAILED (failures=1)

 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/745#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