[Scipy-tickets] [SciPy] #1196: test_stats.test_kstest precision of test too high

SciPy Trac scipy-tickets@scipy....
Fri Jun 11 19:51:10 CDT 2010


#1196: test_stats.test_kstest precision of test too high
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.8.0   
Component:  scipy.stats  |     Version:  0.7.0   
 Keywords:               |  
-------------------------+--------------------------------------------------
 reported by Derek Homeier

 test_stats.test_kstest fails on OS X 10.5 ppc because the precision is too
 high

 {{{
 np.random.seed(987654321)
 x = stats.norm.rvs(loc=0.2, size=100)
 np.array(stats.kstest(x,'norm', alternative = 'greater')) -
          np.array((0.0072115233216310994, 0.98531158590396228))


 yes, just a decimal or two too high, if I got the numbers right:
 # OS X 10.5 i386 / 10.6 x86_64:
 array([  8.67361738e-18,   1.66533454e-15])

 # OS X 10.5 ppc:
 array([  2.05955045e-13,  -7.16759985e-13])
 }}}

 solution:
 replace decimal=14 by decimal=12 in test

 {{{
 1234    assert_almost_equal( np.array(stats.kstest(x,'norm', alternative =
 'greater')),
 - 1235      np.array((0.0072115233216310994, 0.98531158590396228)), 14)

 + 1235      np.array((0.0072115233216310994, 0.98531158590396228)), 12)
 }}}

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


More information about the Scipy-tickets mailing list