View source: R/measures_net_emd.R
netemd_single_pair | R Documentation |
Calculates the minimum Earth Mover's Distance (EMD) between two discrete histograms after normalising each histogram to unit mass and variance. This is calculated as follows: 1. Normalise each histogram to have unit mass and unit variance 2. Find the minimum EMD between the histograms
netemd_single_pair( dhist1, dhist2, method = "optimise", smoothing_window_width = 0 )
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 |
smoothing_window_width |
Width of "top-hat" smoothing window to apply to
"smear" point masses across a finite width in the real domain. Default is 0,
which results in no smoothing. Care should be taken to select a
|
dhists_1 |
A |
dhists_2 |
A |
A list with the following named elements
net_emd
: the NetEMD for the set of histogram pairs, min_offsets
: the associated
offsets giving the minimal EMD for each pair of histograms and min_offset_std
: Offset used in the standardised histograms.
require(igraph) goldstd_1 <- graph.lattice(c(8,8)) goldstd_2 <- graph.lattice(c(44,44)) props_1 <- count_orbits_per_node(graph = goldstd_1,max_graphlet_size = 5) props_2 <- count_orbits_per_node(graph = goldstd_2,max_graphlet_size = 5) dhists_1<- graph_features_to_histograms(props_1) dhists_2<- graph_features_to_histograms(props_2) # Obtain the minimum NetEMD_edges between the histograms netemd_single_pair(dhists_1[[1]],dhists_2[[1]],method = "optimise",smoothing_window_width = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.