kantorovich_ompr: Computes Kantorovich distance with 'ompr'

View source: R/kantorovich_ompr.R

kantorovich_omprR Documentation

Computes Kantorovich distance with 'ompr'

Description

Kantorovich distance using the ompr package

Usage

kantorovich_ompr(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 solve_model is returned with a warning

Note

The glpk solver is the one used to solve the problem.

Examples

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


kantorovich documentation built on Aug. 23, 2023, 1:06 a.m.