Toolbox for Pseudo and Quasi Random Number Generation and RNG Tests

Provides (1) pseudo random generators - general linear congruential generators, multiple recursive generators and generalized feedback shift register (SF-Mersenne Twister algorithm and WELL generators); (2) quasi random generators - the Torus algorithm, the Sobol sequence, the Halton sequence (including the Van der Corput sequence) and (3) some RNG tests - the gap test, the serial test, the poker test. The package depends on rngWELL package but it can be provided without this dependency on demand to the maintainer. For true random number generation, use the 'random' package, for Latin Hypercube Sampling (a hybrid QMC method), use the 'lhs' package. A number of RNGs and tests for RNGs are also provided by 'RDieHarder', all available on CRAN. There is also a small stand-alone package 'rngwell19937' for the WELL19937a RNG.


News

=== randtoolbox: an R package for random number generation and testing ===

Version 1.17

  • change DESCRIPTION file.
  • update NAMESPACE for R 3.3.0.
  • update the LICENSE file.
  • raise a warning when scrambling for Sobol sequences is incocrrect.

BUG REPORT (by Kemal Dincer Dingec and Marius Hofert)

  • scrambling = 1, 3 for Sobol sequences.

Version 1.16

  • change title and other minor things in vignettes.

Version 1.15

  • remove the use of 'long long' in some C code.
  • update LICENCE file.
  • move autoconf files to tools directory.
  • no longer use a4 paper format in vignette.

Version 1.14

  • change licence from BSD_2_clause to BSD_3_clause.
  • minor change.

Version 1.13

  • this version is one of the last versions working with package rngWELL >= 0.11-0.
  • change licence from BSD to BSD_2_clause.

NOTES FIXES

  • remove NOTES appearing in R CMD check.

Version 1.12

NEW FEATURES

  • add new test files.
  • increase the possible dimension of Halton sequences.

WARNING FIXES in Fortran files

  • remove an array over-run (reported by Brian Ripley) and tab characters in LowDiscrepancy.f.

Version 1.11

  • this version is one of the last versions working with package rngWELL == 0.10-x.

NOTE FIXES

  • this version use packageStartupMessage function for the .onAttach rather than the cat function.
  • remove a printf in KnuthTAOCP2002.c

WARNING FIXES in C files

  • remove warnings with Wall and pedantic gcc options. For this purpose, files randtoolbox/src/Makevars and rngWELL/src/Makevars now contain a line, uncommenting which includes Wall and pedantic.

See https://stat.ethz.ch/pipermail/r-sig-mac/2008-August/005251.html

BUG FIXES

  • the package crashes when the dimension was 0 in RNG functions, reported by David LeBauer.

Version 1.10

NEW FEATURES

  • update the man page pseudoRNG.Rd and quasiRNG.Rd with MT19937 and other minor improvements.
  • on loading, the package print the overview man page.

WARNING FIXES

  • fix some warnings following the release of R 2.13.0: the Makefile and the man page of runifInterface.
  • fix a warning in the MT19937 file.

BUG FIXES

  • remove implicit type declaration in the LowDiscrepancy fortran file, which causes errors with GCC 4.6 compilers.

Version 1.09

NEW FEATURES

  • start runif interface for congruential generator and WELL RNG,
  • vignette contains two chapters,
  • start to test true randomness (not included in this version),
  • increase the speed and accuracy of Halton and Sobol sequences.

STRUCTURAL CHANGE

  • Before version 1.09, there was a lot of different (and incompatible) licences in this package, namely, GPL, BSD, public domain, etc... (cf. 1.08-version DESCRIPTION file of this package).
  • From 1.09, all this code of this package is under the new BSD licence. A copy of the BSD licence is available at http://www.opensource.org/licenses/bsd-license.php
  • extract Pierre L'Ecuyer's code from randtoolbox and put it in a dedicated package rngWELL,
  • depends now on rngWELL.

AUTHORS

  • all the code of this package except the ones listed below was written by Yohan Chalabi, Christophe Dutang, Petr Savicky and Diethelm Wuertz.
  • the code for SF-Mersenne Twister belongs to M. Matsumoto and M. Saito, which is under the new BSD licence.
  • the code for Knuth-TAOCP-2002 generator belongs to D. E. Knuth. This code is in the public domain and freely copyable.

BUG FIXES

  • normal transformation of Halton and Sobol sequences is correct.

BUG REPORT

  • Halton and Sobol sequences did not work on 64bit architecture when using normal transformation reported by Anirban Mukherjee,
  • Sobol sequences for dimension > 2 need to be tested.

Version 1.08 (never released on CRAN)

NEW FEATURES

  • add function get.primes,
  • table of primes moved from randtoolbox.c to primes.h and compressed by storing half difference from the previous prime instead of each prime (except for 2 and 3),
  • start runifinterface.

Version 1.07

NEW FEATURES

  • integrate code for Halton, Sobol sequence from fBasics (Rmetrics),
  • randoolbox is now part of Rmetrics project (available on R-forge),
  • increase the speed of congruRand.

BUG FIXES

  • fix setSeed function,
  • a warning shows up on 64 bit architecture.

BUG REPORT

  • setting the seed with WELL's RNGs was not correct, reported by Petr Savicky.

Version 1.06

BUG FIXES

  • the degree of freedom is now correct for the order test.

BUG REPORT

  • Astley Lin reports that the degree-of-freedom(df) of chi-square test is wrong for the order test.

Version 1.05

NEW FEATURES

  • add new WELL generators based on L'Ecuyer's code,
  • add the Sobol and Halton sequences from fOptions package.

BUG FIXES

  • Yes, it compiles on 64bit linux both on CRAN and R-forge.

Version 1.04

BUG REPORT

  • the package does not compil on Fedora 8 x86_64 boxes, reported by Brian Ripley.

Version 1.03

NEW FEATURES

  • add the WELL generator thanks to the code of P. L'Ecuyer,
  • SFMT now allows for different mersenne exponents as well as parameter sets,
  • increase the possible dimension for Torus algorithm from 1000 to 100 000,
  • add the RAN_ARRAY generator of Knuth TAOCP (2002),
  • the function setRandSeed has be renamed by setSeed,
  • update the vignette.

Version 1.02

NEW FEATURES

  • more random generation tests such as collision test and order test,
  • poker test is generalized to any dimension,
  • some auxiliary functions,
  • a detailed vignette on generating and testing random generation.

BUG FIXES

  • on windows, when the seed was not fixed by the user, we use the machine time. But we use only seconds of machine time not micro second like on unix-like system. Hence a call like this

for(i in 1:10) print(congruRand(1)) produces the same output. Now it is fixed.

Version 1.01 (never released on CRAN)

NEW FEATURES

  • add withtorus option for SFMT function,
  • improve output of tests.

Version 1.00

  • Initial release based on the torus package (which is no longer available).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("randtoolbox")

1.17.1 by ORPHANED, 9 days ago


Browse source code at https://github.com/cran/randtoolbox


Authors: R port by Yohan Chalabi, Christophe Dutang, Petr Savicky and Diethelm Wuertz with underlying C codes of (i) the SFMT algorithm from M. Matsumoto and M. Saito, (ii) the Knuth-TAOCP RNG from D. Knuth.


Documentation:   PDF Manual  


Task views: Probability Distributions


BSD_3_clause + file LICENSE license


Depends on rngWELL


Imported by DiceOptim, FDGcopulas, GPM, GPareto, LSDsensitivity, MBHdesign, MRFA, acebayes, cepp, copBasic, joineRML, mcGlobaloptim, minimaxdesign, optim.functions, qualpalr.

Depended on by BLPestimatoR, GPC, KrigInv, TruncatedNormal, iterLap.

Suggested by DiceDesign, copula, sensitivity.


See at CRAN