Learn R Programming

sensitivity (version 1.12.1)

sobolMultOut: Monte Carlo Estimation of Aggregated Sobol' Indices for multiple and functional outputs

Description

sobolMultOut implements the aggregated Sobol' indices for multiple outputs. It consists in averaging all the Sobol indices weighted by the variance of their corresponding output. Moreover, this function plots the functional (unidimensional) Sobol' indices for functional (unidimensional) model output. Sobol' indices for both first-order and total indices are estimated by Monte Carlo formulas.

Usage

sobolMultOut(model = NULL, q = 1, X1, X2, MCmethod = "sobol", 
                         plotFct=FALSE, ...)
## S3 method for class 'sobolMultOut':
print(x, \dots)
## S3 method for class 'sobolMultOut':
plot(x, ylim = c(0, 1), ...)

Arguments

model
a function, or a model with a predict method, defining the model to analyze.
q
dimension of the model output vector.
X1
the first random sample.
X2
the second random sample.
MCmethod
a character string specifying the Monte-Carlo procedure used to estimate the Sobol indices. The avaible methods are : "sobol", "sobol2002", "sobol2007", "soboljansen", sobolmara,
plotFct
if TRUE, 1D functional Sobol indices ares plotted in an external window (default=FALSE).
x
a list of class MCmethod storing the state of the sensitivity study (parameters, data, estimates).
ylim
y-coordinate plotting limits.
...
any other arguments for model which are passed unchanged each time it is called

Value

  • sobolMultOut returns a list of class MCmethod, containing all its input arguments, plus the following components:
  • callthe matched call.
  • Xa data.frame containing the design of experiments.
  • ythe response used
  • Vthe estimations of the aggregated Variances of the Conditional Expectations (VCE) with respect to each factor and also with respect to the complementary set of each factor ("all but $X_i$").
  • Sthe estimations of the aggregated Sobol' first-order indices.
  • Tthe estimations of the aggregated Sobol' total sensitivity indices.

Details

For this function, there are several gaps: the bootstrap estimation of confidence intervals is not avalaible and the tell function does not work.

References

M. Lamboni,H. Monod and D. Makowski, 2011, Multivariate sensitivity analysis to measure global contribution of input factors in dynamic models, Reliability Engineering and System Safety, 96:450-459. F. Gamboa, A. Janon, T. Klein and A. Lagnoux, 2014, Sensitivity indices for multivariate outputs, Electronic Journal of Statistics, 8:575-603.

See Also

sobol, sobol2002, sobol2007, soboljansen, sobolmara, sobolmartinez, sobolGP

Examples

Run this code
# Functional toy function: Arctangent temporal function (Auder, 2011)
# X: input matrix (in [-7,7]^2)
# q: number of discretization steps of [0,2pi] interval
# output: vector of q values

atantemp <- function(X, q = 100){
  
  n <- dim(X)[[1]]
  t <- (0:(q-1)) * (2*pi) / (q-1)
  
  res <- matrix(0,ncol=q,nrow=n)
  for (i in 1:n) res[i,] <- atan(X[i,1]) * cos(t) + atan(X[i,2]) * sin(t)

  return(res)  
}

# Tests functional toy fct 

y0 <- atantemp(matrix(c(-7,0,7,-7,0,7),ncol=2))
#plot(y0[1,],type="l")
#apply(y0,1,lines)

n <- 100
X <- matrix(c(runif(2*n,-7,7)),ncol=2)
y <- atantemp(X)
x11()
plot(y0[2,],ylim=c(-2,2),type="l")
apply(y,1,lines)

# Sobol indices computations

n <- 1000
X1 <- data.frame(matrix(runif(2*n,-7,7), nrow = n))
X2 <- data.frame(matrix(runif(2*n,-7,7), nrow = n))

x11()
sa <- sobolMultOut(model=atantemp, q=100, X1, X2, 
                   MCmethod="soboljansen", plotFct=T)
print(sa)
x11()
plot(sa)

Run the code above in your browser using DataLab