Learn R Programming

sensitivity (version 1.30.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 computes and plots the functional (unidimensional) Sobol' indices for functional (unidimensional) model output via plotMultOut. 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", 
               ubiquitous = FALSE, ...)
  # S3 method for sobolMultOut
print(x, ...)
  # S3 method for sobolMultOut
plot(x, ylim = c(0, 1), ...)
  # S3 method for sobolMultOut
plotMultOut(x, ylim = c(0, 1), ...)
  # S3 method for sobolMultOut
ggplot(data, mapping = aes(), ylim = c(0, 1), ..., environment
                 = parent.frame())

Value

sobolMultOut returns a list of class MCmethod, containing all its input arguments, plus the following components:

call

the matched call.

X

a data.frame containing the design of experiments.

y

the response used

V

the 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\)").

S

the estimations of the aggregated Sobol' first-order indices.

T

the estimations of the aggregated Sobol' total sensitivity indices.

Sfct

the estimations of the functional Sobol' first-order indices (if ubiquitous=TRUE and plot.fct=TRUE).

Tfct

the estimations of the functional Sobol' total sensitivity indices (if ubiquitous=TRUE and plot.fct=TRUE).

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" and "sobolGP".

ubiquitous

if TRUE, 1D functional Sobol indices are computed (default=FALSE).

x

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

data

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

ylim

y-coordinate plotting limits.

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

Bertrand Iooss

Details

For this function, there are several gaps: the bootstrap estimation of confidence intervals is not avalaible and the tell function does not work. Aggregated Sobol' indices can be plotted with the S3 method plot and ubiquitous Sobol' indices can be visualized with the S3 method plotMultOut (does not work for the "sobolGP" method).

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, sobolGP

Examples

Run this code
  # \donttest{
    
    # Tests on the functional toy fct 'Arctangent temporal function'
    
    y0 <- atantemp.fun(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.fun(X)
    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))
    
    sa <- sobolMultOut(model=atantemp.fun, q=100, X1, X2, 
                       MCmethod="soboljansen", ubiquitous=TRUE)
    print(sa)
    plot(sa)
    plotMultOut(sa)
    
    library(ggplot2)
    ggplot(sa)
  # }

Run the code above in your browser using DataLab