Skip to contents

This function evaluates the Sobol G function on a set of input samples generated via crude Monte Carlos. It returns both the sampled inputs and the corresponding function outputs.

Usage

sobol_fun(N, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))

Arguments

N

Integer. Number of input samples to generate.

a

(default: c(0, 1, 4.5, 9, 99, 99, 99, 99)) Numeric vector of non-negative parameters of length 8. These parameters control the sensitivity of each input dimension.

Value

A list with two elements:

  • x: a numeric matrix of size N x 8 containing the input samples.

  • y: a numeric vector of length N with the corresponding function outputs.

Details

The Sobol G function is defined as: $$ Y = \prod_{j=1}^{8} \frac{|\ 4 X_j - 2\ | + a_j}{1 + a_j} $$ where \(X_j \sim \mathcal{U}(0, 1)\) independently.

Examples

result <- sobol_fun(1000)
head(result$x)
#>               X1         X2        X3         X4         X5        X6        X7
#> [1,] 0.648367345 0.17086912 0.7974711 0.15263059 0.40535342 0.6782653 0.5947203
#> [2,] 0.007476662 0.73724916 0.4254239 0.99146874 0.06189615 0.7468293 0.1086689
#> [3,] 0.225094068 0.30623252 0.6467902 0.03144461 0.38418627 0.5547694 0.9850149
#> [4,] 0.496164552 0.04597023 0.3462589 0.10652007 0.79610345 0.9553301 0.2872022
#> [5,] 0.313823511 0.22045919 0.6898496 0.25072225 0.64660427 0.5496882 0.6936231
#> [6,] 0.690876706 0.90556190 0.9185341 0.94673875 0.48145459 0.2509264 0.4091240
#>             X8
#> [1,] 0.8823972
#> [2,] 0.2246130
#> [3,] 0.7290884
#> [4,] 0.5745728
#> [5,] 0.7253485
#> [6,] 0.4980088
head(result$y)
#> [1] 0.73142934 1.86262625 0.97700889 0.02127456 0.74243692 1.18143667