irrelevance_threshold {gsaot} | R Documentation |
Irrelevance threshold for optimal transport sensitivity indices
Description
Calculate irrelevance threshold using dummy variable for Optimal Transport sensitivity indices
Usage
irrelevance_threshold(
y,
M,
dummy_optns = NULL,
cost = "L2",
discrete_out = FALSE,
solver = "sinkhorn",
solver_optns = NULL,
scaling = TRUE
)
Arguments
y |
An array or a matrix containing the output values. |
M |
A scalar representing the number of partitions for continuous inputs. |
dummy_optns |
(default |
cost |
(default |
discrete_out |
(default |
solver |
Solver for the Optimal Transport problem. Currently supported options are:
|
solver_optns |
(optional) A list containing the options for the Optimal Transport solver. See details for allowed options and default ones. |
scaling |
(default |
Details
The function allows the computation of irrelevance threshold.
The function samples from a distribution defined in
dummy_optns
(by default a standard normal), independent from the output
y
and then computes the indices using the algorithm specified in
solver
. Under the hood, lower_bound
calls the other available functions
in the package:
-
ot_indices_1d()
(forsolver="1d"
) -
ot_indices_wb()
(forsolver="wasserstein-bures"
) -
ot_indices()
(forsolver %in% c("sinkhorn", "sinkhorn_log", "wasserstein")
) The user can choose the distribution of the dummy variable using the argumentdummy_optns
.dummy_optns
should be a named list with at least a term called"distr"
defining the sampling function. The other terms in the list are used as arguments to the sampling function.
Value
An object of class gsaot_indices
.
Examples
N <- 1000
mx <- c(1, 1, 1)
Sigmax <- matrix(data = c(1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1), nrow = 3)
x1 <- rnorm(N)
x2 <- rnorm(N)
x3 <- rnorm(N)
x <- cbind(x1, x2, x3)
x <- mx + x %*% chol(Sigmax)
A <- matrix(data = c(4, -2, 1, 2, 5, -1), nrow = 2, byrow = TRUE)
y <- t(A %*% t(x))
M <- 25
dummy_lb <- irrelevance_threshold(y, M)
# Custom sampling funtion and network simplex solver
dummy_optns <- list(distr = "rgamma", shape = 3)
dummy_lb_cust <- irrelevance_threshold(y, M,
dummy_optns = dummy_optns,
solver = "transport")