ot_indices_wb {gsaot}R Documentation

Estimate Wasserstein-Bures approximation of the optimal transport solution

Description

Estimate Wasserstein-Bures approximation of the optimal transport solution

Usage

ot_indices_wb(
  x,
  y,
  M,
  boot = FALSE,
  R = NULL,
  parallel = "no",
  ncpus = 1,
  conf = 0.95,
  type = "norm"
)

Arguments

x

A matrix or data.frame containing the input(s) values. The values can be numeric, factors, or strings. The type of data changes the partitioning. If the values are continuous (double), the function partitions the data into M sets. If the values are discrete (integers, strings, factors), the number of partitioning sets is data-driven.

y

A matrix containing the output values. Each column represents a different output variable, and each row represents a different observation. Only numeric values are allowed.

M

A scalar representing the number of partitions for continuous inputs.

boot

(default FALSE) Logical that sets whether or not to perform bootstrapping of the OT indices.

R

(default NULL) Positive integer, number of bootstrap replicas.

parallel

(default "no") The type of parallel operation to be used (if any). If missing, the default is taken from the option boot.parallel (and if that is not set, "no"). Only considered if boot = TRUE. For more information, check the boot::boot() function.

ncpus

(default 1) Positive integer: number of processes to be used in parallel operation: typically one would chose this to the number of available CPUs. Check the ncpus option in the boot::boot() function of the boot package.

conf

(default 0.95) Number between 0 and 1 representing the default confidence level. Only considered if boot = TRUE. Different confidence levels can be computed as a postprocessing using confint.gsaot_indices().

type

(default "norm") Method to compute the default confidence interval. Only considered if boot = TRUE. For more information, check the type argument of boot::boot.ci(). Different confidence intervals can be computed as a postprocessing using confint.gsaot_indices().

Value

A gsaot_indices object containing:

If boot = TRUE, the object contains also:

See Also

ot_indices(), ot_indices_1d()

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))

x <- data.frame(x)
y <- y

ot_indices_wb(x, y, 10)

[Package gsaot version 1.1.0 Index]