Allow LocalPermutationTest
to be used with TEShannon
estimated using dedicated TE estimators
#350
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.
Fixes
This fixes #348.
The fix here was actually a bit more involved than I thought. Runge's
LocalPermutationTest
is based on conditional mutual information (CMI), and requires that we estimate that CMI in a certain way (that depends on if entropy-based, mutual information-based or CMI-based estimation is used).Using any of these estimation methods, we can simply re-write transfer entropy as CMI, construct relevant marginals and apply the
LocalPermutationTest
directly.However, dedicated transfer entropy estimators such as
Zhu1
orLindner
can't easily be expressed in terms of any of the above-mentioned estimation methods. Therefore, I here introduce a new conditional independence test, specifically aimed for transfer entropy. The concept is similar to what is done for the CMI-basedLocalPermutationTest
: shuffle one variable according to local neighbor information in the conditioning variable. The shuffled variable for transfer entropy is the first( source) variable, similar to what we do forSurrogateTest
.I don't think this transfer entropy-specific local permutation test appears in the literature anywhere, so it would be fun to explore it further at some point in a paper, but that's for future work.
Misc
Lindner
now has an additional layer that is utilized to avoid excessiveStateSpaceSet
allocations during repeated analysis, e.g. usingLocalPermutationTest
. Thus, usingLindner
is now faster withLocalPermutationTest
than it would otherwise be.TODO: