ejoinings: Extreme joinings

View source: R/kantorovich.R

ejoiningsR Documentation

Extreme joinings

Description

Return extreme joinings between mu and nu.

Usage

ejoinings(mu, nu, zeros = FALSE)

Arguments

mu

(row margins) probability measure in numeric or bigq/character mode

nu

(column margins) probability measure in numeric or bigq/character mode

zeros

logical; in case when mu and nu have different lengths, set FALSE to remove lines or columns full of zeros

Value

A list containing the extreme joinings (matrices).

Examples

mu <- nu <- c(0.5, 0.5)
ejoinings(mu, nu)
# use exact arithmetic
library(gmp)
mu <- nu <- as.bigq(c(0.5,0.5))
ejoinings(mu, nu)
# different lengths example
mu <- setNames(as.bigq(c(1,2,4), 7), c("a", "b", "c"))
nu <- setNames(as.bigq(c(3,1), 4), c("b", "c"))
ejoinings(mu, nu)


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