From Martyn.Byng at nag.co.uk  Wed Jul 20 15:59:34 2011
From: Martyn.Byng at nag.co.uk (Martyn Byng)
Date: Wed, 20 Jul 2011 14:59:34 +0100
Subject: [Rd] Randomness not due to seed
References: <1311081181602-3678082.post@n4.nabble.com><BLU166-w543D75409AB00B2B1DB127BE4C0@phx.gbl><4E26C175.1070806@gmail.com><CABFfbXutiefddok9WWSxq0vYiwAomLA3hcmma5nW0PwJyJ8UfQ@mail.gmail.com>
	<4E26DC42.6050604@gmail.com>
Message-ID: <49E76DF37649DC48A4CE882BC8CE51C901C2C1D9@nagmail2.nag.co.uk>

Hi,

Even using the same math libraries you can get different results,
depending on what sorts of instructions those libraries use, see the
following (none R related) blog article:
http://blog.nag.com/2011/02/wandering-precision.html.

Martyn

-----Original Message-----
From: r-devel-bounces at r-project.org
[mailto:r-devel-bounces at r-project.org] On Behalf Of Duncan Murdoch
Sent: 20 July 2011 14:47
To: Jeroen Ooms
Cc: r-devel at r-project.org
Subject: Re: [Rd] Randomness not due to seed

I would guess the error below is because of Java messing around in the 
hardware.  It's pretty common on Windows for DLLs to attempt to change 
the precision setting on the floating point processor; I hadn't seen 
that before on Linux, but that would be my guess as to the cause.

It's also possible that one of the attached packages has messed with R 
functions somehow, e.g. by replacing the default print() or show()
method.

A third possibility is that different math libraries are being used.

So I would consider the differences in the results to be a bit of a bug,

but not one that is likely under our control, and not one that is so 
large that I would worry about working around it.

Duncan Murdoch

On 20/07/2011 8:03 AM, Jeroen Ooms wrote:
> >>  I think Bill Dunlap's answer addressed it:  the claim appears to
be false.
>
> Here is another example where there is randomness that is not due to
> the seed. On the same machine, the same R binary, but through another
> interface. First directly in the shell:
>
> >  sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i686-pc-linux-gnu (32-bit)
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>   [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> >  set.seed(123)
> >  print(coef(lm(dist~speed, data=cars)),digits=22)
>                (Intercept)                     speed
> -17.579094890510951643137   3.932408759124087715975
>
>
>
> # And this is through eclipse (java)
>
> >  sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i686-pc-linux-gnu (32-bit)
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C
>   [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8
>   [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8
>   [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8
> [11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] rj_0.5.2-1
>
> loaded via a namespace (and not attached):
> [1] rJava_0.9-1  tools_2.13.1
>
> >  set.seed(123)
> >  print(coef(lm(dist~speed, data=cars)),digits=22)
>               (Intercept)                    speed
> -17.57909489051087703615   3.93240875912408460735

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.\ _...{{dropped:12}}



[Rd] Randomness not due to seed
Martyn Byng