Skip to contents

$$H(T) = -\sum T_{ij}(\log T_{ij} - 1)$$ Peyre & Cuturi (2019), eq. (4.1). Note the - 1: the OT convention is one nat per unit mass larger than the Shannon entropy and must not be simplified away.

Usage

Otnegent(T)

Arguments

T

Non-negative coupling matrix.

Value

Named list with estimate, shannon, mass, nrow, ncol, method.

References

Peyre & Cuturi (2019), eq. (4.1).

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Otnegent(V)
#> $estimate
#> [1] -23.28196
#> 
#> $shannon
#> [1] -59.28196
#> 
#> $mass
#> [1] 36
#> 
#> $nrow
#> [1] 8
#> 
#> $ncol
#> [1] 1
#> 
#> $method
#> [1] "Discrete entropy H(T) = -sum T(log T - 1) -- Peyre & Cuturi (2019) eq. (4.1)"
#>