Design matrices for quasi-Monte Carlo error estimation
Source:R/quasi-montecarlo.R
generate_design_matrices.Rdgenerate_design_matrices(n, lb, ub, sampler, num_mats) returns a list of
num_mats matrices of n points in the box from lb to ub;
generate_design_matrices(n, d, sampler, num_mats) draws them in the unit
box. A deterministic sampler is randomized independently for every matrix
by its R field, or by R when given; with NoRand() the matrices are
consecutive blocks of dimensions of one num_mats * d dimensional
sequence, which are not independent (QuasiMonteCarlo warns). A random
sampler draws every matrix anew. DesignMatrix() is the iterator form:
$next_matrix() returns the next matrix.
Usage
generate_design_matrices(n, d, ub = NULL, sampler, num_mats = 2L, R = NULL)
DesignMatrix(n, d, sampler, num_mats, R = NULL)Arguments
- n
Number of points per matrix.
- d
Dimension, or the lower bounds when
ubis given.- ub
Upper bounds (bounds form only).
- sampler
A sampler from qmc_samplers.
- num_mats
Number of matrices.
- R
Randomization method; the sampler's
Rby default.
Details
The randomized matrices scramble the same n base points, so each one is a
valid randomized QMC point set and the estimates from different matrices
are independent replicates, but the matrices are dependent column by
column (the i-th points of two matrices are strongly correlated). They
suit replicated error estimation, not designs that need independent pairs
of points such as the A and B matrices of Sobol indices; for those,
randomize one 2 d dimensional point set and split its rows, as gsa()
does.