randsobolfortran | R Documentation |
the Sobol sequence.
sobol.fortran(n, dim = 1, init = TRUE, scrambling = 0, seed = NULL, normal = FALSE, mixed = FALSE, method = "Fortran", mexp = 19937, start = 1, maxit = 10)
n |
number of observations. If length(n) > 1, the length is taken to be the required number. |
dim |
dimension of observations default 1. |
init |
a logical, if |
normal |
a logical if normal deviates are needed, default |
scrambling |
an integer value, if 1, 2 or 3 the sequence is scrambled
otherwise not. If |
seed |
an integer value, the random seed for initialization
of the scrambling process (only for |
mixed |
a logical to combine the QMC algorithm with the SFMT algorithm, default |
method |
a character string either |
mexp |
an integer for the Mersenne exponent of SFMT algorithm,
only used when |
start |
an integer to initiliaze the sequence, default to 1,
only used when |
maxit |
a positive integer used to control inner loops both for generating randomized seed and for controlling outputs (when needed). |
The currently available generator are given below.
Whatever the sequence, when normal=TRUE
, outputs are transformed with
the quantile of the standard normal distribution qnorm
.
If init=TRUE
, the default, unscrambled and unmixed-SFMT quasi-random
sequences start from start
.
If start != 0
and normal=FALSE
,
we suggest to use 0 as recommended by Owen (2020).
One must handle the starting value (0) correctly if a quantile
function of a not-lower-bounded distribution is used.
Computes uniform Sobol low discrepancy numbers.
The sequence starts from k=1 when initialized with
init = TRUE
(default).
When scrambling > 0
, a scrambling is performed
or when mixed = TRUE
, a randomized seed is performed.
If some number of Sobol sequences are generated outside [0,1) with scrambling,
the seed is randomized until we obtain all numbers in [0,1).
One version of Sobol sequences is available the current version in
Fortran (method = "Fortran"
) since method = "C"
is under development.
See the pdf vignette for details.
sobol.fortran
generates random variables in [0,1).
It returns a nxdim matrix, when dim>1
otherwise a vector of length n
.
Christophe Dutang and Diethelm Wuertz
Bratley P., Fox B.L. (1988), Algorithm 659: Implementing Sobol's Quasirandom Sequence Generator, ACM Transactions on Mathematical Software 14, 88–100.
Joe S., Kuo F.Y. (1998), Remark on Algorithm 659: Implementing Sobol's Quaisrandom Seqence Generator.
Owen A.B. (2020), On dropping the first Sobol' point, https://arxiv.org/abs/2008.08051.
# (3) Sobol sequences # # uniform variate sobol.fortran(n = 10, dim = 5, scrambling = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.