min_emd: Minimum Earth Mover's Distance (EMD)

View source: R/emd.R

min_emdR Documentation

Minimum Earth Mover's Distance (EMD)

Description

Calculates the minimum Earth Mover's Distance (EMD) between two discrete histograms. This is the minimum EMD between the two histograms across all possible offsets of histogram 1 against histogram 2.

Usage

min_emd(dhist1, dhist2, method = "optimise")

Arguments

dhist1

A dhist discrete histogram object

dhist2

A dhist discrete histogram object

method

The method to use to find the minimum EMD across all potential offsets for each pair of histograms. Default is "optimise" to use R's built-in stats::optimise method to efficiently find the offset with the minimal EMD. However, this is not guaranteed to find the global minimum if multiple local minima EMDs exist. You can alternatively specify the "exhaustive" method, which will exhaustively evaluate the EMD between the histograms at all offsets that are candidates for the minimal EMD.

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.