reported ?RNG bug
Thomas Lumley
thomas@biostat.washington.edu
Mon, 9 Nov 1998 09:16:27 -0800 (PST)
On Mon, 9 Nov 1998, Mai Zhou wrote:
> RNG in R and Splus 3.4
>
> Prof. Ripley asked the details of the example.
> We were doing parametric bootstrap, so it is similar to simulation.
> Anyway here is the details.
The following code replicates this without needing any specific
hand-coding of numbers each time it is run (except for the slight chance
that y2 will be shorter than 1900 elements)
x1 <- rexp(100, rate=0.3)
theta<-4
x2 <- x1[x1<theta]
x3 <- x2[1:19]
y1<-rexp(4000, rate=0.3)
y2<-y1[y1< max(x3)]
y3<-y2[1:1900]
y4 <- matrix(y3, ncol=19, byrow=T)
maxboot <- apply(y4, 1, max)
biasboot <- mean(maxboot) - max(x3)
biasboot
I ran this 1000 times on S-PLUS 3.4 for Solaris, Rpre0.63 for Solaris,
Guido's R 0.61.3 for Windows (NT) and R0.61.3 for Linux (the oldest R I
have lying around) and got
S-PLUS -0.3040023
Rpre0.63 -0.3083820
R 0.61.3 -0.3054932
WinNT -0.307758
I don't have easy access to RJune, but it seems that on the other current
and recent Rs the example works consistently.
Anyone else tried this on RJune?
-thomas
Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._