# Test case : the non-monotonic Sobol g-function
library(numbers)
# The method of sobol requires 2 samples
# (there are 8 factors, all following the uniform distribution on [0,1])
# first-order sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, levels = 1000, order = 1)
print(x)
plot(x)
# global second-order sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, levels = 1000, order = 2)
print(x)
plot(x)
# Test case : the Ishigami function
# New function because sobolroalhs() works with U[0,1] inputs
ishigami1.fun=function(x) ishigami.fun(x*2*pi-pi)
x <- sobolroalhs(model = ishigami1.fun, factors = 3, levels = 100000, order = 1)
print(x)
plot(x)
x <- sobolroalhs(model = ishigami1.fun, factors = 3, levels = 100000, order = 2)
print(x)
plot(x)Run the code above in your browser using DataLab