[Python] Conditional Mutual information

Discussão em 'Python' iniciado por Stack, Fevereiro 27, 2025.

  1. Stack

    Stack Membro Participativo

    The theoretical approach, i want to convert this into a python program: [​IMG]

    Was trying to test the ditpackage for calculation of conditional mutual information from a dataset.

    My code:

    from __future__ import division
    import numpy as np
    import dit
    from dit import Distribution as D
    from dit.multivariate import coinformation as I
    from dit.example_dists import Xor

    d=Xor()
    d.set_rv_names(['X','Y','Z'])
    X=111010
    Y=101101
    Z=001011

    a=dit.multivariate.coinformation(d,'XY','Z')
    print(a)


    While running this program,the result i always get is "1.0".
    The result come as negative or positive value like "-0.0023" or "0.120"

    Basically,i want to do this https://stats.stackexchange.com/questions/147401/estimating-mutual-information-using-r in Python.

    Continue reading...

Compartilhe esta Página