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))
Value
A list with two elements:
x
: a numeric matrix of sizeN x 8
containing the input samples.y
: a numeric vector of lengthN
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.9222636 0.9317293 0.5849105 0.69579974 0.28583114 0.9497252 0.9209490
#> [2,] 0.8955123 0.1593323 0.9239827 0.90804595 0.86886806 0.3084804 0.9117831
#> [3,] 0.2424790 0.2489793 0.4299888 0.08296870 0.53358307 0.6246266 0.9190424
#> [4,] 0.9807901 0.2072412 0.3286237 0.06581772 0.39884435 0.3873936 0.3062476
#> [5,] 0.5514029 0.9777140 0.1818631 0.44444569 0.07754117 0.3417218 0.3755586
#> [6,] 0.4771317 0.1455893 0.8503451 0.22543863 0.88202763 0.6680449 0.1758310
#> X8
#> [1,] 0.6256670
#> [2,] 0.9289903
#> [3,] 0.3713792
#> [4,] 0.9895016
#> [5,] 0.9475145
#> [6,] 0.5731353
head(result$y)
#> [1] 1.9991444 2.2745854 0.9457347 2.1044012 0.2914062 0.1195523