sobolroalhs
implements the estimation of the Sobol' sensitivity indices introduced by Tissot & Prieur (2012) using two Orthogonal Array-based Latin Hypercubes. This function allows the estimation of all first-order indices or all closed second-order indices (containing the sum of the second-order effect between two inputs and the individual effects of each input) at a total cost of $2 \times N$. For closed second-order indices $N=q^{2}$ where $q \geq d-1$ is a prime number denoting the number of levels of the orthogonal array, and where $d$ is the number of factors.sobolroalhs(model = NULL, factors, runs, order, conf=0.95, tail=TRUE, na.rm=FALSE, ...)
## S3 method for class 'sobolroalhs':
tell(x, y = NULL, \dots)
## S3 method for class 'sobolroalhs':
print(x, \dots)
## S3 method for class 'sobolroalhs':
plot(x, ylim = c(0,1), type="standard", ...)
predict
method,
defining the model to analyze.NA
values."sobolroalhs"
storing the state of the
sensitivity study (parameters, data, estimates).standard
for the basic estimator or monod
for the Janon-Monod estimator.)model
which are passed
unchanged each time it is called.sobolroalhs
returns a list of class "sobolroalhs"
, containing all
the input arguments detailed before, plus the following components:matrix
containing the design of experiments.NULL
if order
=1).NULL
if order
=1).Vs
for the standard variance and Veff
for the Janon-Monod variance).S
for the standard estimator and Seff
for the Janon-Monod estimator).sobolmara
library(numbers)
# 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 sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, runs = 1000, order = 1)
print(x)
plot(x)
# closed second-order sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, runs = 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)
# first-order sensitivity indices
x <- sobolroalhs(model = ishigami1.fun, factors = 3, runs = 100000, order = 1)
print(x)
plot(x)
# closed second-order sensitivity indices
x <- sobolroalhs(model = ishigami1.fun, factors = 3, runs = 100000, order = 2)
print(x)
plot(x)
# dealing with NA values
x <- sobolroalhs(model = NULL, factors = 3, runs = 100000, order =1,na.rm=TRUE)
y <- ishigami1.fun(x$X)
# we randomly insert NA values in y
pos <- sample(length(y),100)
y[pos] <- NA
tell(x,y)
print(x)
plot(x)
Run the code above in your browser using DataLab