In [3]:
from hypothesis import find
import dit
from dit.abc import *
from dit.pid import *
from dit.utils.testing import distribution_structures
dit.ditParams['repr.print'] = dit.ditParams['print.exact'] = True
To illustrate what the distribution source looks like, here we instantiate it with a size
of 3 and an alphabet of 2
:
In [4]:
a = distribution_structures(size=3, alphabet=2)
In [5]:
a.example()
Out[5]:
In [11]:
def pred(value):
return lambda d: dit.multivariate.coinformation(d) < value
In [12]:
ce = find(distribution_structures(3, 2), pred(-1e-5))
print(ce)
print("The coinformation is: {}".format(dit.multivariate.coinformation(ce)))
In [13]:
ce = find(distribution_structures(3, 2), pred(-0.5))
print(ce)
print("The coinformation is: {}".format(dit.multivariate.coinformation(ce)))
In [14]:
def b_lt_k(d):
k = dit.multivariate.gk_common_information(d)
b = dit.multivariate.dual_total_correlation(d)
return k > b
In [15]:
find(distribution_structures(size=3, alphabet=3, uniform=True), b_lt_k)
In [16]:
ce = find(distribution_structures(3, 2, True), lambda d: PID_BROJA(d) != PID_Proj(d))
ce
Out[16]:
In [17]:
print(PID_BROJA(ce))
print(PID_Proj(ce))
In [ ]: