[SciPy-Dev] seeded randn gets different values on osx

Vincent Davis vincent at vincentdavis.net
Sun Jun 13 11:07:59 EDT 2010


On Sun, Jun 13, 2010 at 8:57 AM, Charles R Harris <charlesr.harris at gmail.com
> wrote:

>
> On Sat, Jun 12, 2010 at 10:06 PM, <josef.pktd at gmail.com> wrote:
>
>> On Sat, Jun 12, 2010 at 10:09 PM, Charles R Harris
>> <charlesr.harris at gmail.com> wrote:
>> >
>> >
>> > On Sat, Jun 12, 2010 at 7:44 PM, Vincent Davis <
>> vincent at vincentdavis.net>
>> > wrote:
>> >>
>> >> There was another tread (scipy 8.0b release) describing a problem with
>> >> FAIL: test_stats.test_kstest see full test fail below.
>> >>
>> >> After a little discusion with Josef here are some results. It appears
>> >> to me that osx gets different values from a seeded randn
>> >>
>> >> >From Josef, I assume windows
>> >> >>>>> np.random.seed(0)
>> >> >>>>> np.random.randn(3)
>> >> >> array([ 1.76405235,  0.40015721,  0.97873798])
>> >> >
>> >> On my machine OSX py 2.6.5, numpy 1.4.0 scipy 8.0b
>> >> >>>> np.random.seed(0)
>> >> >>>> np.random.randn(3)
>> >> > array([ 0.06897149,  1.32078057,  1.5997924 ])
>> >>
>> >> ubuntu 10.0.4  py 2.5.6 current scipy and numpy just built from the git
>> >> source.
>> >> >>> np.random.seed(0)
>> >> >>> np.random.randn(3)
>> >> array([ 1.76405235,  0.40015721,  0.97873798])
>> >>
>> >> FAIL: test_stats.test_kstest
>> >> ----------------------------------------------------------------------
>> >> Traceback (most recent call last):
>> >>  File
>> >>
>> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/nose/case.py",
>> >> line 186, in runTest
>> >>   self.test(*self.arg)
>> >>  File
>> >>
>> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/scipy/stats/tests/test_stats.py",
>> >> line 1228, in test_kstest
>> >>   assert_almost_equal( D, 0.12464329735846891, 15)
>> >>  File
>> >>
>> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/numpy/testing/utils.py",
>> >> line 459, in assert_almost_equal
>> >>   raise AssertionError(msg)
>> >> AssertionError:
>> >> Arrays are not almost equal
>> >>  ACTUAL: 0.093893737596468518
>> >>  DESIRED: 0.12464329735846891
>> >> ______
>> >
>> > There were some changes to the random normal generator in trunk, but I
>> don't
>> > think they should affect this. What versions of numpy is everyone using?
>>
>> I'm also using numpy 1.4.0, but the results for the random numbers in
>> the tests have been hard coded for 19 months ( numpy 1.3.0 ?)
>>
>> OS X 10.5 ppc:darwin-ppc in 0.7.2 and 0.8.0b1 numpy 1.4.1(?) has a
>> small divergence 10e-13 (Derek Homeier)
>>
>> OSX py 2.6.5, numpy 1.4.0 scipy 8.0b is pretty far off  (Vincent)
>>
>> This is a numpy issue that shows up in stats because of the tests.
>>
>>
> I don't see anything obvious in the revision history. Does the uniform
> distribution also show changes? It is also possible that compiler
> optimizations are messing with the code, unlikely, but it would be nice to
> know the compiler versions used and/or 64 bits vs 32 bits. There is at least
> one numpy test that depends on random numbers from a given seed being
> reproducible and it isn't showing any problems. Sounds like we need to add a
> test specifically to test reproducibility.
>
> I am running the recent Enthought release 6.2. I get the same results for
both the 64bit and 32 bit version.

Python 2.6.5 |EPD 6.2-1 (32-bit)| (r265:79063, May 28 2010, 15:13:03)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin

Python 2.6.5 |EPD 6.2-1 (64-bit)| (r265:79063, May 28 2010, 15:24:16)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin

Is it possible to know what svn/git branch/revision.. is installed? It seems
it would be nice for this info to be part of something like
scipy.__version__

Vincent


Chuck
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
  *Vincent Davis
720-301-3003 *
vincent at vincentdavis.net
 my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100613/99378f8a/attachment.html>


More information about the SciPy-Dev mailing list