[SciPy-Dev] ANN: SciPy 0.8.0 beta 1
Vincent Davis
vincent@vincentdavis....
Sat Jun 12 14:02:54 CDT 2010
On Fri, Jun 11, 2010 at 6:41 PM, <josef.pktd@gmail.com> wrote:
> On Fri, Jun 11, 2010 at 7:54 PM, Derek Homeier
> <derek@astro.physik.uni-goettingen.de> wrote:
>> Hi Josef,
>>
>>>> FAIL: test_stats.test_kstest
>>>> ----------------------------------------------------------------------
>>>> Traceback (most recent call last):
>>>> File "/sw/lib/python2.6/site-packages/nose/case.py", line 186, in runTest
>>>> self.test(*self.arg)
>>>> File "/sw/lib/python2.6/site-packages/scipy/stats/tests/test_stats.py", line 1078, in test_kstest
>>>> np.array((0.0072115233216310994, 0.98531158590396228)), 14)
>>>> File "/sw/lib/python2.6/site-packages/numpy/testing/utils.py", line 441, in assert_almost_equal
>>>> return assert_array_almost_equal(actual, desired, decimal, err_msg)
>>>> File "/sw/lib/python2.6/site-packages/numpy/testing/utils.py", line 765, in assert_array_almost_equal
>>>> header='Arrays are not almost equal')
>>>> File "/sw/lib/python2.6/site-packages/numpy/testing/utils.py", line 609, in assert_array_compare
>>>> raise AssertionError(msg)
>>>> AssertionError:
>>>> Arrays are not almost equal
>>>>
>>>> (mismatch 100.0%)
>>>> x: array([ 0.007, 0.985])
>>>> y: array([ 0.007, 0.985])
>>>
>>> maybe the precision (decimal 14) is too high for this test across platforms
>>>
>>> Could you check how large the difference is ?
>>>
>>> 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))
>>>
>>> (my line numbers differ, but this should be the right test given your numbers)
>>
>>
>> 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])
>
> interesting that there are differences in the calculations, but for
> the test we can just reduce the precision to decimal=12 to avoid the
> test failure.
I must be doing something wrong here becuase I don't get anything
close that what you have above.
In [4]: np.random.seed(987654321)
In [5]: x = stats.norm.rvs(loc=0.2, size=100)
In [6]: r1 = np.array(stats.kstest(x,'norm', alternative = 'greater'))
In [7]: r2 = np.array((0.0072115233216310994, 0.98531158590396228))
In [8]: r1-r2
Out[8]: array([ 0.03704986, -0.32866092])
Vincent
>
> Thanks,
> Josef
>
>>
>> Cheers,
>> Derek
>>
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
More information about the SciPy-Dev
mailing list