5.6.2.9. statsmodels.sandbox.infotheo.mutualinfo

statsmodels.sandbox.infotheo.mutualinfo(px, py, pxpy, logbase=2)[source]

Returns the mutual information between X and Y.

Parameters:

px : array-like

Discrete probability distribution of random variable X

py : array-like

Discrete probability distribution of random variable Y

pxpy : 2d array-like

The joint probability distribution of random variables X and Y. Note that if X and Y are independent then the mutual information is zero.

logbase : int or np.e, optional

Default is 2 (bits)

Returns:

shannonentropy(px) - condentropy(px,py,pxpy)