lower_bound | R Documentation |
Calculate lower bounds for Optimal Transport sensitivity indices
lower_bound(
y,
M,
bound = "dummy",
dummy_optns = NULL,
cost = "L2",
discrete_out = FALSE,
solver = "sinkhorn",
solver_optns = NULL,
scaling = TRUE
)
y |
An array or a matrix containing the output values. |
M |
A scalar representing the number of partitions for continuous inputs. |
bound |
(default |
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 |
The function allows the computation of two different lower bounds.
With bound="dummy"
, 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()
(for solver="1d
)
ot_indices_wb()
(for solver="wasserstein-bures"
)
ot_indices()
(for solver %in% c("sinkhorn", "sinkhorn_log", "wasserstein")
)
The user can choose the distribution of the dummy variable using the
argument dummy_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. With
bound="entropic"
, the function computes the lower bound of the entropic
indices. In this case, solver
should be either "sinkhorn"
or
"sinkhorn_log"
An object of class gsaot_indices
for bound="dummy"
or a scalar
for bound="entropic"
.
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
sink_lb <- lower_bound(y, M, bound = "entropic")
dummy_lb <- lower_bound(y, M, bound = "dummy")
# Custom sampling funtion and network simplex solver
dummy_optns <- list(distr = "rgamma", shape = 3)
dummy_lb_cust <- lower_bound(y, M, bound = "dummy",
dummy_optns = dummy_optns,
solver = "transport")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.