sobol_matrices {sensobol}R Documentation

Creation of the sample matrices

Description

It creates the sample matrices to compute Sobol' first and total-order indices. If needed, it also creates the sample matrices required to compute second and third-order indices. It uses Sobol' quasi-random number sequences.

Usage

sobol_matrices(n, k, second = FALSE, third = FALSE, cluster = NULL)

Arguments

n

Integer, sample size of the Sobol' matrix.

k

Integer, number of model inputs.

second

Logical. If second = TRUE, it creates the scrambled matrix required to compute second-order indices. Default is second = FALSE.

third

Logical. If third = TRUE, it creates the scrambled matrix required to compute third-order indices. Default is third = FALSE.

cluster

List of vectors, each vector including the column number of the parameters forming the cluster. The default is cluster = NULL

Details

If cluster = NULL, the function generates an (n, 2k) matrix using Sobol' quasi-random number sequences. The first k-matrix is the A matrix and the remaining k-matrix, the B matrix. It then generates k additional matrices (A^j_B), j=1,2,...,k, where the k matrix is composed of all columns of the A matrix except the j-th column, which is the j column of the B matrix. This approach leds to a total number of model runs of n(k + 2) for first and total-order indices (Saltelli et al. 2010).

If a list of vectors is assigned to cluster, the output is a scrambled matrix with all columns from matrix A except those of the parameters included in the cluster, which come from matrix B.

Value

A matrix.

References

Saltelli A, Annoni P, Azzini I, Campolongo F, Ratto M, Tarantola S (2010). “Variance based sensitivity analysis of model output. Design and estimator for the total sensitivity index.” Computer Physics Communications, 181(2), 259–270. ISSN 00104655, doi: 10.1016/j.cpc.2009.09.018.

See Also

Check the function sobol in the package randtoolbox to see how the Sobol' quasi-random number sequences are constructed.

Examples

sobol_matrices(n = 100, k = 8, second = TRUE, third = TRUE)

[Package sensobol version 0.2.2 Index]