sobol {sensitivity} | R Documentation |
sobol
is the implementation of the Monte Carlo estimation of
the Sobol indices.
sobol(method = "sobol93", model = NULL, x1, x2, max.order = 1, nboot = 0, conf = 0.95, ...)
method |
the method: "sobol93" or "saltelli02" |
model |
the model |
x1 |
the first random sample |
x2 |
the second random sample |
max.order |
the maximum order of indices to compute (method "sobol93") |
nboot |
the number of bootstrap replicates |
conf |
the confidence level for bootstrap confidence intervals |
... |
any other arguments for model which are passed
unchanged each time it is called |
Two methods. The method "sobol93" computes all the Sobol indices
(coming from the HDMR-ANOVA decomposition) from order 1 to order
given by the argument max.order
. The method "saltelli02"
computes both first order and total indices at a reduced computational
cost.
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.
sobol
returns an object of class "sobol"
.
An object of class "sobol"
is a list containing the following
components:
x |
the factor sample |
y |
the response used |
S |
the estimations of the Sobol sensitivity indices |
St |
the estimations of the total indices (method "saltelli02") |
For the method "sobol93", the number of model evaluations is n * (N + 1) where n is the size of the
samples x1
and x2
, and N is the number of indices
to estimate.
For the method "saltelli02", the number of model evaluations is n * (p + 2) where p is the number of factors (for the estimation of 2p indices).
Saltelli, A., Chan, K. and Scott, E. M., 2000, Sensitivity analysis. Wiley.
Sobol, I. M., 1993, Sensitivity analysis for non-linear mathematical model. Math. Modelling Comput. Exp., 1, 407–414.
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 <- 1000 x <- data.frame(matrix(nr = 2 * n, nc = 8)) for (i in 1:8) x[, i] <- runif(2 * n) # sensitivity analysis sa <- sobol(model = sobol.fun, x1 = x[1:n,], x2 = x[(n+1):(2*n),], max.order = 2, nboot = 100) print(sa) #plot(sa)