# Test case : the non-monotonic Sobol g-function
# The method of sobol requires 2 samples
# There are 8 factors, all following the uniform distribution
# on [0,1]
n <- 1000
x1 <- data.frame(matrix(nr = n, nc = 8))
x2 <- data.frame(matrix(nr = n, nc = 8))
for (i in 1:8){
x1[, i] <- runif(n)
x2[, i] <- runif(n)
}
# sensitivity analysis
sa <- sobol(model = sobol.fun, x1 = x1, x2 = x2, order = 2, nboot = 100)
print(sa)
#plot(sa)
Run the code above in your browser using DataLab