Random number generators provided by R extension packages are set using
RNGkind("user-supplied")
. The package randtoolbox assumes that
this function is not called by the user directly and is called from
the functions set.generator()
and put.description()
.Random number generators in randtoolbox are represented at the R level by a list
containing mandatory components name, parameters, state
and possibly an
optional component authors
. The function set.generator()
internally
creates this list from the user supplied information and then runs put.description()
on this list, which initializes the generator. If the generator is initialized, then the
function get.description()
may be used to get the actual state of the generator,
which may be stored in an R object and used later in put.description()
to continue
the sequence of the random numbers from the point, where get.description()
was called. This may be used to generate several independent streams of random numbers
generated by different generators.
The component parameters
is a character or a numeric vector, whose structure
is different for different types of the generators. This vector may be passed
to set.generator()
, if it is prepared before its call, however, it is
also possible to pass its named components via the ...
parametr of
set.generator()
and the vector parameters
is created internally.
If the vector parameters
is not supplied and the arguments in ...
are not sufficient to create it, an error message is produced.
Linear congruential generators{
Parameters for the linear congruential generators (name="congruRand"
)
are integers represented either as a character or a numeric vector. The
components are
[object Object],[object Object],[object Object]
}
WELL generators{
Parameters for the WELL generators is a character vector with components
[object Object],[object Object]
The concatenation of order
and version
should belong to
"512a", "521a", "521b", "607a", "607b", "800a", "800b", "1024a", "1024b",
"19937a", "19937b", "19937c", "21701a", "23209a", "23209b", "44497a", "44497b"
.
When order and version are specified in ...
parametr of set.generator()
,
then the parameter order
is optional and if missing, it is assumed that the
parameter version
contains also the number of bits in the internal state
and the combination belongs to the list above.
}
Mersenne Twister 2002 generator{
Parameters for the Mersenne Twister 2002 is a character vector with components
[object Object],[object Object]
}