kantorovich_lp: Computes Kantorovich distance with lp_solve

Description Usage Arguments Examples

View source: R/kantorovich_lpsolve.R

Description

Kantorovich distance using the lpSolve package

Usage

1
2
kantorovich_lp(mu, nu, dist = NULL, solution = FALSE, lp.object = FALSE,
  ...)

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, to use only if lp.object=FALSE; if TRUE the solution is returned in the "solution" attributes of the output

lp.object

logical, if FALSE, the output is the Kantorovich distance; if TRUE, the output is a lp.object

...

arguments passed to lp

Examples

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

stla/kantorovich documentation built on May 26, 2017, 9 p.m.