Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #42, as discussed in that thread.
Problem
#42 changed the last line of
poisson_conditional_mutual_informationtocmi = H_YZ - H_XYZ.H_YZandH_XYZare differences ofpoisson_joint_entropyterms built from the adjusted matrixSS, not plain conditional entropies, so with that sign the raw CMI is negative for dependent data. The wrapper clamps it to 0 and Poisson discovery finds no edges.Changes
cmi = H_XYZ - H_YZ(the order used byCompute_CMI_Poissonin jefish003/NetworkInference) and replace the inline comment that suggested the opposite. Thenp.ix_indexing from fix: kde_entropy numerical stability, np.matrix removal, Poisson CMI sign #42 is kept.test_poisson_cmi_via_main_function: compare the wrapper withmax(0.0, direct). X, Y and Z are independent in that test, so the raw value can be slightly negative and the wrapper clamps it. The test only passed before because of the old indexing offset and then because of the flipped sign.test_poisson_cmi_count_data_properties: also check that the conditional estimate is positive (it is -0.66 on current main).test_poisson_cmi_sign_dependent_vs_independent: over 20 datasets, the raw CMI is positive on every dependent dataset (mean > 0.2) and its mean is close to 0 on independent data.causationentropy/tests/test_poisson_discovery.py: a ~4 second standard oCSE run withinformation="poisson"onpoisson_coupled_oscillators, so the Poisson path is covered by the default suite. The existing Poisson integration tests are deselected by default, which is why fix: kde_entropy numerical stability, np.matrix removal, Poisson CMI sign #42 passed CI.Validation
python -m pytest causationentropy/tests/test_data_integration.py -k poisson -o addopts="":test_standard_poissonandtest_alternative_poissonboth pass (they fail on current main, as reported in fix: kde_entropy numerical stability, np.matrix removal, Poisson CMI sign #42).black --check,isort --check-onlyand the flake8 hard gate pass.Not included: the
SS = SXYZaliasing andfill_diagonalquestions that @jefish003 is looking into.