11% File src / library / base / man / Random.Rd
22% Part of the R package , https : // www.R - project.org
3- % Copyright 1995 - 2024 R Core Team
3+ % Copyright 1995 - 2025 R Core Team
44% Distributed under GPL 2 or later
55
66\name {Random }
@@ -65,14 +65,16 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
6565 30323)}.
6666 The \I {Wichmann}--\I {Hill} generator has a cycle length of
6767 \e qn{6.9536 \t imes 10^{12}}{6.9536e12} (=
68- \c ode{prod(p-1)/4}, see \e mph{Applied Statistics} (1984)
69- \b old{33}, 123 which corrects the original article).
68+ \c ode{prod(p-1)/4}, see
69+ \b ibcitet{R:Wichmann+Hill:1984}
70+ which corrects the original article).
7071 It exhibits 12 clear failures in the \I {TestU01} Crush suite and 22
71- in the \I {BigCrush} suite ( \b ibcite{L ' Ecuyer , 2007 }) . }
72+ in the \I {BigCrush} suite \b ibcitep{R:L_Ecuyer+Simard: 2007}.}
7273
7374 \i tem{\c ode{"Marsaglia-Multicarry"}:}{
7475 A \e mph{multiply-with-carry} RNG is used, as recommended by George
75- \I {Marsaglia } in his post to the mailing list \file {sci.stat.math }.
76+ \I {Marsaglia} in his post to the mailing list \f ile{sci.stat.math}
77+ \b ibcitep{R:Marsaglia:1997}.
7678 It has a period of more than \e qn{2^{60}}{2^60}.
7779
7880 It exhibits 40 clear failures in \I {L' Ecuyer }' s \I {TestU01} Crush suite.
@@ -89,17 +91,17 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
8991 4.6*10^18} for most initial seeds. The seed is two integers (all
9092 values allowed for the first seed: the second must be odd).
9193
92- We use the implementation by Reeds \ abbr { et al. }\sspace( 1982 -- 84 ) .
94+ We use the implementation by \b ibcitet{R:Reeds+Hubert+Abrahams: 1982-4} .
9395
9496 The two seeds are the \I {Tausworthe} and congruence long integers,
9597 respectively.
9698
9799 It exhibits 25 clear failures in the \I {TestU01} Crush suite
98- (\ bibcite { L ' Ecuyer, 2007}) .
100+ \b ibcitep{R:L_Ecuyer+Simard: 2007}.
99101 }
100102
101103 \i tem{\c ode{"Mersenne-Twister"}:}{
102- From \b ibcite{ Matsumoto and Nishimura ( 1998) }; code updated in 2002.
104+ From \b ibcitet{R: Matsumoto+ Nishimura: 1998}; code updated in 2002.
103105 A twisted \a bbr{GFSR} with period
104106 \e qn{2^{19937} - 1}{2^19937 - 1} and equidistribution in 623
105107 consecutive dimensions (over the whole period). The \s Quote{seed} is a
@@ -110,8 +112,8 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
110112 not affected by the initialization issue in the 1998 code of
111113 \I {Matsumoto} and \I {Nishimura} addressed in a 2002 update.
112114
113- It exhibits 2 clear failures in each of the \I {TestU01} Crush and the
114- \I {BigCrush} suite ( \b ibcite{L ' Ecuyer , 2007 }) .
115+ It exhibits 2 clear failures in each of the \I {TestU01} Crush and
116+ the \I {BigCrush} suite \b ibcitep{R:L_Ecuyer+Simard: 2007}.
115117 }
116118
117119 \i tem{\c ode{"Knuth-TAOCP-2002"}:}{
@@ -125,7 +127,7 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
125127 }
126128
127129 \i tem{\c ode{"Knuth-TAOCP"}:}{
128- An earlier version from Knuth ( 1997 ) .
130+ An earlier version from \b ibcitet{R: Knuth: 1997} .
129131
130132 The 2002 version was not backwards compatible with the earlier
131133 version: the initialization of the \a bbr{GFSR} from the seed was altered.
@@ -139,14 +141,11 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
139141
140142 It exhibits 3 clear failure in the \I {TestU01} Crush suite and
141143 4 clear failures in the \I {BigCrush} suite
142- (\ emph {\ I { L ' Ecuyer}}, 2007) .
144+ \b ibcitep{R:L_Ecuyer+Simard: 2007} .
143145 }
144146 \i tem{\c ode{"L' Ecuyer - CMRG " }:}{
145147 A \s Quote{combined multiple-recursive generator} from
146- %% <FIXME: bibcite>
147- %% \I {L'Ecuyer} (1999),
148148 \b ibcitet{R:L_Ecuyer:1999},
149- %% </FIXME>
150149 each element of which is a feedback multiplicative
151150 generator with three integer elements: thus the seed is a (signed)
152151 integer vector of length 6. The period is around
@@ -161,8 +160,8 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
161160 basis for the multiple streams used in package \p kg{parallel}.
162161 % See \c ode{\l ink{RngStream}}.
163162
164- It exhibits 6 clear failures in each of the \I {TestU01} Crush and the
165- \I {BigCrush} suite ( \e mph{ \I {L'Ecuyer}}, 2007) .
163+ It exhibits 6 clear failures in each of the \I {TestU01} Crush and
164+ the \I {BigCrush} suite \b ibcitep{R:L_Ecuyer+Simard: 2007} .
166165 }
167166
168167 \i tem{\c ode{" user - supplied " }:}{
@@ -255,99 +254,30 @@ set.seed(seed, kind = NULL, normal.kind = NULL, sample.kind = NULL)
255254 \c ode{set.seed} returns \c ode{NULL}, invisibly.
256255}
257256\r eferences{
258- Ahrens, J. H. and Dieter, U. (1973).
259- Extensions of Forsythe's method for random sampling from the normal
260- distribution.
261- \e mph{Mathematics of Computation}, \b old{27}, 927--937.
262-
263- Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988).
264- \e mph{The New S Language}.
265- Wadsworth & Brooks/Cole.
266- (\c ode{set.seed}, storing in \c ode{.Random.seed}.)
267-
268- Box, G. E. P. and Muller, M. E. (1958).
269- A note on the generation of normal random deviates.
270- \e mph{Annals of Mathematical Statistics}, \b old{29}, 610--611.
271- \d oi{10.1214/aoms/1177706645}.
272-
273- De Matteis, A. and Pagnutti, S. (1993).
274- Long-range Correlation Analysis of the Wichmann-Hill Random Number
275- Generator.
276- \e mph{Statistics and Computing}, \b old{3}, 67--70.
277- \d oi{10.1007/BF00153065}.
278-
279- Kinderman, A. J. and Ramage, J. G. (1976).
280- Computer generation of normal random variables.
281- \e mph{Journal of the American Statistical Association}, \b old{71},
282- 893--896.
283- \d oi{10.2307/2286857}.
284-
285- Knuth, D. E. (1997).
286- \e mph{The Art of Computer Programming}.
287- Volume 2, third edition.\c r
288- Source code at \u rl{https://www-cs-faculty.stanford.edu/~knuth/taocp.html}.
289-
290- Knuth, D. E. (2002).
291- \e mph{The Art of Computer Programming}.
292- Volume 2, third edition, ninth printing.
293-
294- \I {L'Ecuyer}, P. (1999).
295- Good parameters and implementations for combined multiple recursive
296- random number generators.
297- \e mph{Operations Research}, \b old{47}, 159--164.
298- \d oi{10.1287/opre.47.1.159}.
299-
300- %% <FIXME bibcite>
301- %% \I {L'Ecuyer}, P. and Simard, R. (2007).
302- %% \I {TestU01}: A C Library for Empirical Testing of Random Number Generators
303- %% \e mph{ACM Transactions on Mathematical Software}, \b old{33}, Article 22.
304- %% \d oi{10.1145/1268776.1268777}.
305- %% \c r The \I {TestU01} C library is available from
306- %% \u rl{https://simul.iro.umontreal.ca/testu01/tu01.html} or also
307- %% \u rl{https://github.com/umontreal-simul/TestU01-2009}.
308- %% </FIXME>
309-
310- %% <FIXME bibcite>
311- \b ibinfo{R:Simard+L_Ecuyer:2007}{footer}{
257+ \b ibinfo{R:Becker+Chambers+Wilks:1988}{footer}{
258+ (\\\\\\ code{set.seed}, storing in \\\\\\ code{.Random.seed}.)}
259+ \b ibinfo{R:Knuth:1997}{footer}{
260+ Source code at \\\\\\ url{https://www-cs-faculty.stanford.edu/~knuth/taocp.html}.}
261+ \b ibinfo{R:L_Ecuyer+Simard:2007}{footer}{
312262 The \\\\\\ I{TestU01} C library is available from
313263 \\\\\\ url{https://simul.iro.umontreal.ca/testu01/tu01.html} or also
314264 \\\\\\ url{https://github.com/umontreal-simul/TestU01-2009}.
315265 }
316- \b ibshow{R:Simard+L_Ecuyer:2007}
317- %% </FIXME>
318-
319- Marsaglia, G. (1997).
320- \e mph{A random number generator for C}.
321- Discussion paper, posting on Usenet newsgroup \c ode{sci.stat.math} on
322- September 29, 1997.
323-
324- Marsaglia, G. and Zaman, A. (1994).
325- Some portable very-long-period random number generators.
326- \e mph{Computers in Physics}, \b old{8}, 117--121.
327- \d oi{10.1063/1.168514}.
328-
329- Matsumoto, M. and Nishimura, T. (1998).
330- Mersenne Twister: A 623-dimensionally equidistributed uniform
331- pseudo-random number generator,
332- \e mph{ACM Transactions on Modeling and Computer Simulation},
333- \b old{8}, 3--30.\c r
334- Source code formerly at \c ode{http://www.math.keio.ac.jp/~matumoto/emt.html}.\c r
335- Now see \u rl{https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/c-lang.html}.
336-
337- Reeds, J., Hubert, S. and Abrahams, M. (1982--4).
338- C implementation of SuperDuper, University of California at Berkeley.
339- (Personal communication from Jim Reeds to Ross Ihaka.)
340-
341- Wichmann, B. A. and Hill, I. D. (1982).
342- Algorithm AS 183: An Efficient and Portable Pseudo-random Number
343- Generator.
344- \e mph{Applied Statistics}, \b old{31}, 188--190; Remarks:
345- \b old{34}, 198 and \b old{35}, 89.
346- \d oi{10.2307/2347988}.
347-
348- %% <FIXME bibcite>
349- \b ibshow{*}
350- %% </FIXME>
266+ \b ibinfo{R:Matsumoto+Nishimura:1998}{footer}{
267+ Source code formerly at \\\\\\ code{http://www.math.keio.ac.jp/~matumoto/emt.html}.
268+ Now see \\\\\\ url{https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/c-lang.html}.}
269+ \b ibinfo{R:Wichmann+Hill:1982}{note}{Remarks:
270+ \\\\\\ bold{34}, 198 and \\\\\\ bold{35}, 89.}
271+
272+ \b ibshow{*,
273+ R:Ahrens+Dieter:1973,
274+ R:Becker+Chambers+Wilks:1988,
275+ R:Box+Muller:1958,
276+ R:De_Matteis+Pagnutti:1993,
277+ R:Kinderman+Ramage:1976,
278+ R:Knuth:2002,
279+ R:Marsaglia+Zaman:1994,
280+ R:Wichmann+Hill:1982}
351281}
352282\a uthor{of RNGkind: Martin Maechler. Current implementation, B. D. Ripley
353283 with modifications by Duncan Murdoch.}
0 commit comments