[SciPy-user] Bug in stats?

Paul Ray Paul.Ray at nrl.navy.mil
Tue Jan 24 10:07:55 CST 2006


On Jan 24, 2006, at 10:53 AM, David Huard wrote:

> To use the stats method, try giving it the parameters explicitely,  
> as in
> >>> gamma.stats(1.5, loc=4., scale =5.)
> (array(11.5), array(37.5))

It seems to be broken for me...

In [1]: import scipy
Overwriting fft=<function fft at 0x130d7f0> from scipy.fftpack.basic  
(was <function fft at 0x12fc970> from numpy.dft.fftpack)
Overwriting ifft=<function ifft at 0x130d830> from  
scipy.fftpack.basic (was <function inverse_fft at 0x12fc9b0> from  
numpy.dft.fftpack)

In [2]: scipy.stats.norm.stats()
Out[2]: (nan, nan)

In [3]: scipy.stats.norm.stats(loc=4.0,scale=5.0)
Out[3]: (nan, nan)

In [4]: scipy.stats.norm.stats(1.5, loc=4.0,scale=5.0)
Out[4]: (nan, nan)

In [5]: scipy.stats.gamma.stats(1.5, loc=4., scale =5.)
Out[5]: (nan, nan)

In [6]: scipy.__version__
Out[6]: '0.4.4'

In [8]: os.uname()
Out[8]:
('Darwin',
'mcxr2.nrl.navy.mil',
'8.4.0',
'Darwin Kernel Version 8.4.0: Tue Jan  3 18:22:10 PST 2006;  
root:xnu-792.6.56.obj~1/RELEASE_PPC',
'Power Macintosh')

Curiously, it passes the tests, so they must not tickle this bug:
In [9]: scipy.stats.test(10)
   Found 92 tests for scipy.stats.stats
   Found 70 tests for scipy.stats.distributions
   Found 10 tests for scipy.stats.morestats
   Found 92 tests for scipy.stats
   Found 0 tests for __main__
........................................................................ 
........................................................................ 
....................Ties preclude use of exact statistic.
..Ties preclude use of exact statistic.
........................................................................ 
..........................
----------------------------------------------------------------------
Ran 264 tests in 1.635s

OK
Out[9]: <unittest.TextTestRunner object at 0x2321890>


However, my old version of scipy on a linux box works OK:
 >>> import scipy
 >>> scipy.stats.norm.stats()
(0.0, 1.0)
 >>> scipy.stats.gamma.stats(1.5, loc=4., scale =5.)
(11.5, 37.5)
 >>> scipy.__version__
'0.3.2'

Cheers,

-- Paul

--
Dr. Paul S. Ray              E-mail: Paul.Ray at nrl.navy.mil
Naval Research Laboratory    WWW   : http://xweb.nrl.navy.mil/ 
personnel/paulr/
Code 7655                    Phone : (202) 404-1619
Washington, DC 20375         AIM   : NRLPSR




More information about the SciPy-user mailing list