5.6.2.3. statsmodels.sandbox.infotheo.corrent

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

An information theoretic correlation measure.

Reflects linear and nonlinear correlation between two random variables X and Y, characterized by the discrete probability distributions px and py respectively.

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, optional

Joint probability distribution of X and Y. If pxpy is None, X and Y are assumed to be independent.

logbase : int or np.e, optional

Default is 2 (bits)

Returns:

mutualinfo(px,py,pxpy,logbase=logbase)/shannonentropy(py,logbase=logbase)

Notes

This is also equivalent to

corrent(px,py,pxpy) = 1 - condent(px,py,pxpy)/shannonentropy(py)