multi_marginal: Solve the multimarginal optimal transport problem by linear...

Description Usage Arguments Value Examples

View source: R/multimarginal_LP.R

Description

Solves the N-fold multimarginal optimal transport problem between N specified measures and a specified cost. This is essentially a convenient wrapper function that builds and solves the corresponding linear program.

Usage

1

Arguments

weights

A list of vectors specifying the weights of the marginal distributions. These vectors do not need to be of the same size.

costA

An array where the entry (i1,i2,...,iN) specifies the value of the cost functional for the point i1 in the first measure, i2 in the second measure and so on.

Value

A list with two entries. The first entry contains the optimal multicoupling in array form, and the second entry contains the cost of the optimal solution.

Examples

1
2
3
W<-list(rep(1,10),rep(1,10),rep(1,10))
C<-array(runif(10^3),c(10,10,10))
MM<-multi_marginal(W,C)

WSGeometry documentation built on Dec. 15, 2021, 1:08 a.m.