def test_data_processing_inequality_exact(dist): """ given X - Y - Z: G(X:Z) <= G(X:Y) """ g_xy = G(dist, [[0], [1]]) g_xz = G(dist, [[0], [2]]) assert g_xz <= g_xy + 10 * epsilon
def test_cis2(dist): """ Test that the common informations are ordered correctly. """ k = K(dist) j = J(dist) b = B(dist) c = C(dist) g = G(dist) f = F(dist) m = M(dist) assert k <= j + epsilon assert j <= b + epsilon assert b <= c + epsilon assert c <= g + epsilon assert g <= f + epsilon assert f <= m + epsilon
def test_eci1(rvs, crvs, val): """ Test against known values. """ assert G(xor, rvs, crvs) == pytest.approx(val, abs=1e-4)