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:
-
- Returns:
float – The weighted pointwise mutual information.
- Return type:
float