Cohesion

The cohesion [RNE+16] is a parameterized multivariate mutual information which interpolates between the Total Correlation (\(k = 1\)) and the Dual Total Correlation (\(k = n-1\)):

\[C_k[X_0 : X_1 : \dotsc : X_n] = \sum_{\substack{A \subset [n]}{|A| = k}} \H{X_A} - \binom{n - 1}{k - 1} \H{X_0, X_1, \dotsc, X_n}\]

The later O-information of [RMGJ19] is the single difference \(\T{} - \B{}\); see O-Information.

On a three-variable giant bit, \(C_1 = 2\) (total correlation) and \(C_2 = 1\) (dual total correlation):

In [1]: from dit.multivariate import cohesion

In [2]: from dit.example_dists import giant_bit

In [3]: d = giant_bit(3, 2)

In [4]: cohesion(d, 1)
Out[4]: 2.0

In [5]: cohesion(d, 2)
Out[5]: 1.0

API

cohesion(dist, k, rvs=None, crvs=None)[source]

Computes the k-cohesion.

Parameters:
  • dist (Distribution) – The distribution from which the cohesion is calculated.

  • k (int, 1 <= k < N) – The order of the cohesion to compute.

  • rvs (list, None) – A list of lists. Each inner list specifies the indexes of the random variables used to calculate the total correlation. If None, then the total correlation is calculated over all random variables, which is equivalent to passing rvs=dist.rvs.

  • crvs (list, None) – A single list of indexes specifying the random variables to condition on. If None, then no variables are conditioned on.

Returns:

C_k – The k-Cohesion.

Return type:

float

Raises:

ditException – Raised if dist is not a joint distribution or if rvs or crvs contain non-existant random variables.