pyphi.measures.distribution.weighted_pointwise_mutual_information#

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

Compute the weighted pointwise mutual information (WPMI).

This is defined as

\[p \log_2\left(\frac{p}{q}\right)\]

when \(p \neq 0\) and \(q \neq 0\), and \(0\) otherwise.

Parameters:
  • p (float) – The first probability.

  • q (float) – The second probability.

Returns:

float – The weighted pointwise mutual information.

Return type:

float