From @t@rk @ending from @t@t@berkeley@edu  Wed Sep 19 18:18:18 2018
From: @t@rk @ending from @t@t@berkeley@edu (Philip B. Stark)
Date: Wed, 19 Sep 2018 09:18:18 -0700
Subject: [Rd] Bias in R's random integers?
In-Reply-To: <997228e9-7b3f-0ab9-6541-b347de00b40c@gmail.com>
References: <CAN_1p9wVX=AR8aYtC2LJo0bgN9cRW3XcbYJqnVHdCzA-QA1ceg@mail.gmail.com>
 <ffb74021-8d95-a820-8013-f0e51dc1a9b3@gmail.com>
 <CAARY7khVi==mZs5o_8fZkTUDDuY-ABwE=gA45COX7qbRgBLhsg@mail.gmail.com>
 <997228e9-7b3f-0ab9-6541-b347de00b40c@gmail.com>
Message-ID: <CAA7KnHGSWG9N_zynoKpCtbsN9MES_D60ukbP4sUwcLo5Zhz+qw@mail.gmail.com>

That depends on the number of replications, among other things.

Moreover, because of the bias, the usual formulae for uncertainty in
estimates based on random samples, etc., are incorrect: sample() does not
give a simple random sample.

On Wed, Sep 19, 2018 at 9:15 AM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

> On 19/09/2018 9:40 AM, David Hugh-Jones wrote:
> >
> >
> > On Wed, 19 Sep 2018 at 13:43, Duncan Murdoch <murdoch.duncan at gmail.com
> > <mailto:murdoch.duncan at gmail.com>> wrote:
> >
> >
> >     I think the analyses are correct, but I doubt if a change to the
> >     default
> >     is likely to be accepted as it would make it more difficult to
> >     reproduce
> >     older results.
> >
> >
> > I'm a bit alarmed by the logic here. Unbiased sampling seems basic for a
> > statistical language. As a consumer of R I'd like to think that e.g. my
> > bootstrapped p values are correct.
> > Surely if the old results depend on the biased algorithm, then they are
> > false results?
>
> All Monte Carlo results contain Monte Carlo error.  Using the biased
> function will have some additional error, but for almost all
> simulations, it will be negligible compared to the Monte Carlo error.  I
> suspect the only simulations where the bias was anywhere near the same
> order of magnitude as the Monte Carlo error would be ones designed with
> this specific code in mind.
>
> Duncan Murdoch
>
>

-- 
Philip B. Stark | Associate Dean, Mathematical and Physical Sciences |
Professor,  Department of Statistics |
University of California
Berkeley, CA 94720-3860 | 510-394-5077 | statistics.berkeley.edu/~stark |
@philipbstark

	[[alternative HTML version deleted]]



[Rd] Bias in R's random integers?
Philip B. Stark