# NOT RUN {
# }
# NOT RUN {
# 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])
# first-order indices estimation
x <- sobolrec(model = sobol.fun, factors = 8, layers=rep(2,each=15), order=1,
precision = c(5*10^(-2),2), method=NULL, tail=TRUE)
print(x)
# closed second-order indices estimation
x <- sobolrec(model = sobol.fun, factors = 8, layers=11^2, order=2,
precision = c(10^(-2),3), method="al", tail=TRUE)
print(x)
# Test case: dealing with external model
x <- sobolrec(model = NULL, factors = 8, layers=rep(2,each=15), order=1,
precision = c(5*10^(-2),2), method=NULL, tail=TRUE)
toy <- sobol.fun
k <- 1
stop_crit <- FALSE
while(!(stop_crit) & (k<length(x$layers))){
ask(x, index=k)
y <- toy(x$block)
tell(x, y, index=k)
stop_crit <- x$stop_crit
k <- k+1
}
print(x)
# }
Run the code above in your browser using DataLab