ejoinings: Extreme joinings

Description Usage Arguments Value Examples

View source: R/kantorovich.R

Description

Return extreme joinings between mu and nu.

Usage

1
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 differente lengths, set FALSE to remove lines or columns full of zeros

Value

A list containing the extreme joinings (matrices).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

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