Learn R Programming

sensitivity (version 1.30.1)

sobolSalt: Monte Carlo Estimation of Sobol' Indices based on Saltelli schemes

Description

sobolSalt implements the Monte Carlo estimation of the Sobol' indices for either both first-order and total effect indices at the same time (alltogether \(2p\) indices) at a total cost of \(n\times(p+2)\) model evaluations; or first-order, second-order and total indices at the same time (alltogether \(2p+ p\times(p-1)/2\) indices) at a total cost of \(n\times(2\times p+2)\) model evaluations.

Usage

sobolSalt(model = NULL, X1, X2, scheme="A", nboot = 0, conf = 0.95, ...)
# S3 method for sobolSalt
tell(x, y = NULL, ...)
# S3 method for sobolSalt
print(x, ...)
# S3 method for sobolSalt
plot(x, ylim = c(0, 1), choice, ...)
# S3 method for sobolSalt
ggplot(data, mapping = aes(), ylim = c(0, 1), choice, ..., environment
                 = parent.frame())

Value

sobolSalt returns a list of class "sobolSalt", containing all the input arguments detailed before, plus the following components:

call

the matched call.

X

a data.frame containing the design of experiments.

y

the response used.

V

the model variance.

S

the estimations of the Sobol' first-order indices.

S2

the estimations of the Sobol' second-order indices (only for scheme "B").

T

the estimations of the Sobol' total sensitivity indices.

Arguments

model

a function, or a model with a predict method, defining the model to analyze.

X1

the first random sample (containing n points).

X2

the second random sample (containing n points).

scheme

a letter "A" or "B" indicating which scheme to use (see "Details")

nboot

the number of bootstrap replicates.

conf

the confidence level for bootstrap confidence intervals.

x

a list of class "sobolSalt" storing the state of the sensitivity study (parameters, data, estimates).

data

a list of class "sobolSalt" storing the state of the sensitivity study (parameters, data, estimates).

y

a vector of model responses.

ylim

y-coordinate plotting limits.

choice

an integer specifying which indices to plot: 1 for first-order and total effect indices, 2 for second-order indices.

mapping

Default list of aesthetic mappings to use for plot. If not specified, must be supplied in each layer added to the plot.

environment

[Deprecated] Used prior to tidy evaluation.

...

any other arguments for model which are passed unchanged each time it is called

Author

Laurent Gilquin

Details

The estimators used are the one implemented in "sobolEff".

scheme specifies which Saltelli's scheme is to be used: "A" to estimate both first-order and total effect indices, "B" to estimate first-order, second-order and total effect indices.

References

A. Janon, T. Klein, A. Lagnoux, M. Nodet, C. Prieur (2014), Asymptotic normality and efficiency of two Sobol index estimators, ESAIM: Probability and Statistics, 18:342-364.

A. Saltelli, 2002, Making best use of model evaluations to compute sensitivity indices, Computer Physics Communication, 145:580-297.

See Also

sobol, sobol2007, soboljansen, sobolmartinez, sobolEff

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]

library(boot)
n <- 1000
X1 <- data.frame(matrix(runif(8 * n), nrow = n))
X2 <- data.frame(matrix(runif(8 * n), nrow = n))

# sensitivity analysis

x <- sobolSalt(model = sobol.fun, X1, X2, scheme="A", nboot = 100)
print(x)
plot(x, choice=1)

library(ggplot2)
ggplot(x, choice=1)

Run the code above in your browser using DataLab