Ports of the point set generators of QuasiMonteCarlo.jl. Pass a sampler to
qmc_sample() or generate_design_matrices(). Deterministic samplers
(SobolSample(), HaltonSample(), FaureSample(), KroneckerSample(),
GoldenSample(), LatticeRuleSample(), VanDerCorputSample() and
GridSample()) carry a default randomization R (see
randomization_methods); random samplers (RandomSample(),
LatinHypercubeSample() and RandomizedHaltonSample()) draw a new point
set at every call.
Usage
SobolSample(R = NoRand())
HaltonSample(R = NoRand())
FaureSample(R = NoRand())
LatticeRuleSample(R = NoRand())
GridSample(R = NoRand())
VanDerCorputSample(base, R = NoRand())
KroneckerSample(generator = NULL, R = NoRand())
GoldenSample(...)
RandomSample(rng = NULL)
LatinHypercubeSample(rng = NULL)
RandomizedHaltonSample(rng = NULL)Arguments
- R
Randomization method applied to the point set,
NoRand()by default.- base
Prime base of the van der Corput sequence.
- generator
Generating vector of the Kronecker sequence;
NULLtakes the powers of the harmonious number of the dimension (the generalized golden ratio).- ...
Arguments of
KroneckerSample().- rng
NULLfor R's generator, or a function ofnreturningnuniform numbers on [0, 1).
Details
The deterministic sequences match Julia bit for bit. Random draws use R's generator, so seeded results differ from Julia's.
Examples
qmc_sample(8, 2, SobolSample())
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.1875 0.6875 0.9375 0.4375 0.3125 0.8125 0.5625 0.0625
#> [2,] 0.3125 0.8125 0.0625 0.5625 0.1875 0.6875 0.4375 0.9375
qmc_sample(9, c(0, -1), c(1, 1), HaltonSample())
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 0.05555556 0.5555556 0.3055556 0.8055556 0.1805556 0.6805556 0.4305556
#> [2,] -0.88888889 -0.2222222 0.4444444 -0.6666667 0.0000000 0.6666667 -0.4444444
#> [,8] [,9]
#> [1,] 0.9305556 0.1180556
#> [2,] 0.2222222 0.8888889