min_emd_exhaustive: Minimum Earth Mover's Distance (EMD) using exhaustive search

View source: R/emd.R

min_emd_exhaustiveR Documentation

Minimum Earth Mover's Distance (EMD) using exhaustive search

Description

Calculates the minimum Earth Mover's Distance (EMD) between two discrete histograms using an exhaustive search.

Usage

min_emd_exhaustive(dhist1, dhist2)

Arguments

dhist1

A dhist discrete histogram object

dhist2

A dhist discrete histogram object

Details

When "sliding" two piecewise-linear empirical cumulative mass functions (ECMFs) across each other to minimise the EMD between them, it is sufficient to calculate the EMD at all offsets where any knots from the two ECMFs align to ensure that the offset with the global minimum EMD is found.

This is because of the piece-wise linear nature of the two ECMFs. Between any two offsets where knots from the two ECMFs align, EMD will be either constant, or uniformly increasing or decreasing. Therefore, there the EMD between two sets of aligned knots cannot be smaller than the EMD at one or other of the bounding offsets.

Value

Earth Mover's Distance between the two discrete histograms


alan-turing-institute/network-comparison documentation built on June 7, 2022, 10:41 p.m.