-
assigned issue to
Mutual information of independent variables expected to be exacly 0.0
(die1,die2) = lea.interval(1,6).new(2)
lea.mutual_information(die1,die2)
# -> 2.6645352591003757e-15
The expected value is 0.0 because die1
and die2
are independent. However, due to numerical representation with float, the returned value is not 0.0, although very small.
Similarily, .
die1.cond_entropy(die2)
# -> 2.5849625007211534
die1.entropy
# -> 2.584962500721156
The conditional entropy between two independent variables is expected to be exaclty equal to the entropy of the first.
The issue occurs also when using symbolic computation, producing long formulas that, although correct, fail to be simplified.
The independence could be easily detected, so as to force the exact expected value explicitely in these two methods.
Comments (8)
-
reporter -
reporter - edited description
-
reporter - edited description
-
reporter Add Lea.is_dependent_of method and use it in Lea.mutual_information and Lea.cond_entropy (refs
#64)→ <<cset d4424056ca64>>
-
reporter Correct get_alea_leaves_set (renamed get_leaves_set, now returning Alea, Olea, Plea), remove *ceiling arguments + misc refactoring (refs
#64)→ <<cset 02d603c748b0>>
-
reporter Test get_leaves_set and is_dependent_of methods (refs
#64)→ <<cset 22adc8cc8092>>
-
reporter Update doc of get_leaves_set of method (refs
#64)→ <<cset fa009d277e53>>
-
reporter - changed status to resolved
- Log in to comment