Skip to content
Back to formatted view

Raw Message

Message-ID: <9e2ba306-a830-8897-f714-9bf422b876e5@beuth-hochschule.de>
Date: 2019-05-09T16:43:01Z
From: Ulrike Grömping
Subject: [R-pkg-devel]  Change in normal random numbers between R 3.5.3 and R 3.6.0
In-Reply-To: <781fdde6-8154-372e-9804-a68c56205067@gmail.com>

Hmmmh, but does that also apply if the sample.kind has been set to the 
old version? I.e., would

if (getRversion()>="3.6.0") RNGkind(sample.kind="Rounding")
val <- 10
set.seed(val)
discard <- sample(1000, 100)
rnorm(36)

produce the same normal random numbers in 3.5.3 and 3.6.0? I would have 
expected it to, but it seems to produce the same normal random numbers 
as R version 3.6.0 in the previous version of the test code without the 
RNGkind call.

Best, Ulrike

Am 09.05.2019 um 16:19 schrieb Duncan Murdoch:
> That is:? I'd expect this code to give identical results in both 
> versions, whether I used val <- 10 or any other value:
>
> val <- 10
> set.seed(val)
> rnorm(36)
>
> This code does not give identical results, because the calls to 
> sample() will result in different changes to the seed:
>
> val <- 10
> set.seed(val)
> discard <- sample(1000, 100)
> rnorm(36) 


-- 
##############################################
## Prof. Ulrike Groemping
## FB II
## Beuth University of Applied Sciences Berlin
##############################################
## prof.beuth-hochschule.de/groemping
## Phone: +49(0)30 4504 5127
## Fax:   +49(0)30 4504 66 5127
## Home office: +49(0)30 394 04 863
##############################################