pyphi.measures.distribution.hamming_emd#

pyphi.measures.distribution.hamming_emd(p, q)[source]#

Return the Earth Mover’s Distance between two distributions (indexed by state, one dimension per node) using the Hamming distance between states as the transportation cost function.

Supports non-binary (k-ary) substrates: the ground metric is the number of nodes whose state differs, taken over the substrate’s actual (possibly heterogeneous) state space. Singleton dimensions are squeezed out.

Parameters:
  • p (ArrayLike)

  • q (ArrayLike)

Return type:

float