Skip to contents

Earth Mover's Distance between two distributions over one domain

Usage

morie_emd(p, q, ground = "ordered", hierarchy = NULL, domain = NULL)

Arguments

p, q

Distributions over a common ordered domain.

ground

One of "ordered" (default), "equal" or "hierarchical".

hierarchy

Named list, node -> character vector of children, for ground = "hierarchical".

domain

The sensitive domain in order.

Value

The EMD, a single number.

References

Li, N., Li, T., & Venkatasubramanian, S. (2007). t-Closeness: privacy beyond k-anonymity and l-diversity. ICDE.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_emd(V, V)
#> [1] 0