kantorovich_glpk: Computes Kantorovich distance with GLPK

Description Usage Arguments Examples

View source: R/kantorovich_glpk.R

Description

Kantorovich distance using the Rglpk package

Usage

1
2
3
4
5
6
7
8
kantorovich_glpk(
  mu,
  nu,
  dist = NULL,
  solution = FALSE,
  stop_if_fail = TRUE,
  ...
)

Arguments

mu

(row margins) probability measure in numeric mode

nu

(column margins) probability measure in numeric mode

dist

matrix, the distance to be minimized on average; if NULL, the 0-1 distance is used.

solution

logical; if TRUE the solution is returned in the "solution" attributes of the output

stop_if_fail

logical; if TRUE, an error is returned in the case when no solution is found; if FALSE, the output of Rglpk_solve_LP is returned with a warning

...

arguments passed to Rglpk_solve_LP

Examples

1
2
3
mu <- c(1/7,2/7,4/7)
nu <- c(1/4,1/4,1/2)
kantorovich_glpk(mu, nu)

kantorovich documentation built on Oct. 29, 2020, 1:06 a.m.