Skip to contents

Create Sobol sampling matrices using sensobol::sobol_matrices() and an mctable definition. The function generates quasi-random draws in [0, 1] and then maps them to the target distributions defined in mctable$mc_func (or mctable$func) and mctable$sample_space.

Usage

mctable_sobol_matrices(
  mctable = set_mctable(),
  N,
  matrices = c("A", "B", "AB"),
  order = c("first", "second", "third", "fourth"),
  type = c("QRN", "LHS", "R"),
  mc_names = NULL,
  ...
)

Arguments

mctable

(data frame). Table containing at least mcnode and sample_space; may also contain mc_func / func.

N

(integer). Base sample size (see sensobol::sobol_matrices()).

matrices

(character). Which Sobol matrices to create (see sensobol::sobol_matrices()). Default: c("A", "B", "AB").

order

(character). Either "first", "second", "third", or "fourth" (see sensobol::sobol_matrices()).

type

(character). Sampling design used by sensobol::sobol_matrices(). In sensobol 1.1.6, options include "QRN" (default), "LHS", and "R".

mc_names

(character vector, optional). Node names to include. If NULL, all nodes in mctable$mcnode are used.

...

Additional arguments passed to sensobol::sobol_matrices() (and potentially to randtoolbox::sobol() when type = "QRN").

Value

A numeric matrix where each column is a model input distributed in (0, 1) after mapping to the distributions defined in the mctable, and each row is a sampling point. The matrix has the same layout/row binding as sensobol::sobol_matrices().

Details

If the distribution function is missing but numeric bounds are available in sample_space (e.g. min = 0, max = 1 or c(0, 1)), the function assumes a uniform distribution (stats::runif).