Learn R Programming

sensitivity (version 1.2)

sobol: Sobol Non-linear Sensitivity Analysis

Description

sobol is the implementation of the standard Monte Carlo estimation of the Sobol indices. This function generates the design of experiments based on two independent samples and computes the requested indices. These indices are ALL the Sobol anova-like decomposition indices, from the first order to the order given by the user.

Usage

sobol(model = NULL, x1, x2, order = 1,
      nboot = 0, conf = 0.95, ...)
## S3 method for class 'sobol':
compute(sa, y = NULL)

Arguments

model
the model.
x1
the first random sample for factors.
x2
the second random sample for factors.
order
the maximum order of indices to compute.
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.

Value

  • sobol returns an object of class "sobol". An object of class "sobol" is a list containing the following components:
  • modelthe model.
  • x1the first random sample for factors.
  • x2the second random sample for factors.
  • orderthe maximum order of indices to compute.
  • nbootthe number of bootstrap replicates.
  • confthe confidence level for bootstrap confidence intervals.
  • xthe factor sample.
  • ythe response used.
  • Sthe estimations of the anova decomposition sensitivity indices.
  • callthe matched call.

Details

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.

With this method, the estimation of the all the indices from the order 1 to the order $k$ (given by the order paremeter) require $$n\sum_{j=0}^k \frac{p!}{j!(p-j)!}$$ calls to the model, with $n$ the length of the samples x1 and x2, and $p$ the number of factors.

References

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.

See Also

sensitivity compute

Examples

Run this code
# 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
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(model = sobol.fun, x1 = x1, x2 = x2, order = 2, nboot = 100)
print(sa)
#plot(sa)

Run the code above in your browser using DataLab