Skip to contents

generate_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 ub is given.

ub

Upper bounds (bounds form only).

sampler

A sampler from qmc_samplers.

num_mats

Number of matrices.

R

Randomization method; the sampler's R by default.

Value

A list of d x n matrices; DesignMatrix() returns an iterator.

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.

Examples

set.seed(1)
AB <- generate_design_matrices(16, c(0, 0), c(1, 2), SobolSample(R = QMCShift()), 2)
lengths(AB)
#> [1] 32 32