Implement compute_pmi(joint_counts, total_counts_x, total_counts_y, total_samples) returning the PMI of two events from counts, with N = total_samples, p(x)=cx/N, p(y)=cy/N and p(x,y)=cxy/N:
PMI(x,y)=log2p(x)p(y)p(x,y)
- Round the result to 3 decimal places.
- If
joint_counts is 0, return float('-inf').