sobol.sal02 {sensitivity} | R Documentation |
sobol.sal02
is the implementation of the Sobol indices
estimation method proposed by Saltelli. The particularity of this
method is to estimate both first order and total order indices with
the same sampling scheme. This function generates the design of
experiments based on two independent samples and computes the
requested indices.
sobol.sal02(model = NULL, x1, x2, nboot = 0, conf = 0.95, ...) ## S3 method for class 'sobol.sal02': compute(sa, y = NULL)
model |
the model. |
x1 |
the first random sample for factors. |
x2 |
the second random sample for factors. |
nboot |
the number of bootstrap replicates. |
conf |
the confidence level for bootstrap confidence intervals. |
sa |
the sensitivity analysis object. |
y |
the response. |
... |
any other arguments for model which are passed
unchanged each time it is called. |
model
is a function or a predictor (a class with a
predict
method) computing the response y
based on the
sample given by x
. If no model is specified, the indices will be
computed when one gives the response.
The Monte Carlo estimation requires two independent random samples
x1
and x2
. They must have the same dimensions.
The computing scheme is based on replacement of a column of a sample by the corresponding one of the other sample. We note {x1,i,x2} the sample where all the columns are taken from x1, except the i-th one that is taken from x2.
Then, the first order index corresponding to the i-th factor is given by:
S_i = D_i / Var(Y)
where
D_i = 1 / (n - 1) * sum( f(x2) * f({x1,i,x2}) ) - 1 / n * sum( f(x1) * f(x2) )
and the total order index is given by:
St_i = 1 - Dt_i / Var(Y)
where
Dt_i = 1 / (n - 1) * sum( f(x1) * f({x1,i,x2}) ) - [ 1 / n * sum( f(x1) )]^2
With this method, the estimation of all the first order indices and
total indices require n * (p + 2) calls to the model,
with n the length of the samples x1
and x2
,
and p the number of factors.
sobol.sal02
returns an object of class "sobol.sal02"
.
An object of class "sobol.sal02"
is a list containing the following
components:
model |
the model. |
x1 |
the first random sample for factors. |
x2 |
the second random sample for factors. |
nboot |
the number of bootstrap replicates. |
conf |
the confidence level for bootstrap confidence intervals. |
x |
the factor sample. |
y |
the response used. |
S1 |
the estimations of the first order indices. |
St |
the estimations of the total sensitivity indices. |
call |
the matched call. |
Saltelli, A., 2002, Making best use of model evaluations to compute sensitivity indices. Computer Physics Communication, 145, 580–297.
# 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 <- 3000 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.sal02(model = sobol.fun, x1 = x1, x2 = x2, nboot = 100) print(sa) plot(sa)