pyphi.measures.distribution.emd#
- pyphi.measures.distribution.emd(p, q, direction=None)[source]#
Compute the EMD between two repertoires for a given direction.
The full EMD computation (
hamming_emd()) is used for cause repertoires. A fast analytic solution (effect_emd()) is used for effect repertoires, exploiting the independence of the nodes in an effect repertoire.- Parameters:
p (np.ndarray) – The first repertoire.
q (np.ndarray) – The second repertoire.
direction (Direction or None) –
CAUSEorEFFECT. IfEFFECT,effect_emd()is used; otherwisehamming_emd()is used.Noneis treated asCAUSE.
- Returns:
DistanceResult – The EMD between
pandq, carryingmethod="EMD"and thedirectionas metadata. The value is not rounded.- Raises:
ValueError – If
directionis invalid.- Return type: