Learn R Programming

sensitivity (version 1.8-1)

sobolroalhs: Sobol' Indices Estimation Using Replicated OA-based LHS

Description

sobolroalhs implements the estimation of the Sobol' sensitivity indices introduced by Tissot & Prieur (2012) using two Orthogonal Array-based Latin Hypercubes. This function allows the estimation of all first-order indices at a total cost of $2 \times N$ or all second-order subset indices (containing the sum of the second-order effect between two inputs and the individual effects of each input) at a cost of $2 \times q^{2}$ where $q$ is a prime number.

Usage

sobolroalhs(model = NULL, factors, levels, order, choice="A", conf=0.95, ...)
## S3 method for class 'sobolroalhs':
tell(x, y = NULL, \dots)
## S3 method for class 'sobolroalhs':
print(x, \dots)
## S3 method for class 'sobolroalhs':
plot(x, ylim = c(0, 1), type="standard", ...)

Arguments

model
a function, or a model with a predict method, defining the model to analyze.
factors
an integer specifying the number of factors, or a vector of character strings giving their names.
levels
an integer specifying the number of levels of the design.
order
an integer specifying the order of the indices (1 or 2).
choice
a character (A or B) specifying the method to generate the orthogonal array-based design (A for the Bose method and B for the Hadamard generalized matrix based method).
conf
the confidence level for confidence intervals.
x
a list of class "sobolroalhs" storing the state of the sensitivity study (parameters, data, estimates).
y
a vector of model responses.
ylim
coordinate plotting limits for the indices values.
type
a character specifying the type of estimator to plot (standard for the basic estimator or monod for the Janon-Monod estimator.)
...
any other arguments for model which are passed unchanged each time it is called.

Value

  • sobolroalhs returns a list of class "sobolroalhs", containing all the input arguments detailed before, plus the following components:
  • callthe matched call.
  • Xa matrix containing the design of experiments.
  • ya vector of model responses.
  • Va data.frame containing the estimations of the variance (Vs for the standard variance and Veff for the Janon-Monod variance).
  • Sa data.frame containing the estimations of the Sobol' sensitivity indices (S for the standard estimator and Seff for the Janon-Monod estimator).

Details

The method used by sobolroalhs only considers models whose inputs follow uniform distributions on [0,1]. The transformations of each input (between its initial distribution and a U[0,1] distribution) have therefore to be realized before the call to sobolroalhs(). Bootstrap confidence intervals are not available with this method ; the given confidence intervals come from asymptotical formula.

References

Tissot, J. Y. and Prieur, C. (2012), Estimating Sobol's indices combining Monte Carlo integration and Latin hypercube sampling. A.S. Hedayat, N.J.A. Sloane, John Stufken (1999), Orthogonal Arrays: Theory and Applications.

See Also

sobol, sobolmara

Examples

Run this code
# Test case : the non-monotonic Sobol g-function
library(numbers)

# The method of sobol requires 2 samples
# (there are 8 factors, all following the uniform distribution on [0,1])

# first-order sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, levels = 1000, order = 1)
print(x)
plot(x)

# global second-order sensitivity indices
x <- sobolroalhs(model = sobol.fun, factors = 8, levels = 1000, order = 2)
print(x)
plot(x)

# Test case : the Ishigami function

# New function because sobolroalhs() works with U[0,1] inputs
ishigami1.fun=function(x) ishigami.fun(x*2*pi-pi)

x <- sobolroalhs(model = ishigami1.fun, factors = 3, levels = 100000, order = 1)
print(x)
plot(x)

x <- sobolroalhs(model = ishigami1.fun, factors = 3, levels = 100000, order = 2)
print(x)
plot(x)

Run the code above in your browser using DataLab