SA_estimate {COINr}R Documentation

Estimate sensitivity indices


Post process a sample to obtain sensitivity indices. This function takes a univariate output which is generated as a result of running a Monte Carlo sample from SA_sample() through a system. Then it estimates sensitivity indices using this sample.


SA_estimate(yy, N, d, Nboot = NULL)



A vector of model output values, as a result of a N(d+2) Monte Carlo design.


The number of sample points per dimension.


The dimensionality of the sample


Number of bootstrap draws for estimates of confidence intervals on sensitivity indices. If this is not specified, bootstrapping is not applied.


This function is built to be used inside get_sensitivity().


A list with the output variance, plus a data frame of first order and total order sensitivity indices for each variable, as well as bootstrapped confidence intervals if !is.null(Nboot).

See Also


# This is a generic example rather than applied to a COIN (for reasons of speed)

# A simple test function
testfunc <- function(x){
x[1] + 2*x[2] + 3*x[3]

# First, generate a sample
X <- SA_sample(500, 3)

# Run sample through test function to get corresponding output for each row
y <- apply(X, 1, testfunc)

# Estimate sensitivity indices using sample
SAinds <- SA_estimate(y, N = 500, d = 3, Nboot = 1000)
# Notice that total order indices have narrower confidence intervals than first order.

[Package COINr version 1.1.7 Index]