MAINT: review funcionality and use of CouplingAnalysis.get_nearest_neighbors()
and add a specific test
#199
Labels
maintenance
something should be improved or is outdated
CouplingAnalysis.get_nearest_neighbors()
is currently only used as a helper method forCouplingAnalysis.mutual_information()
andCouplingAnalysis.information_transfer()
and tested indirectly through those. After having ported the underlying C method to Cython in #195, it appeared sensible to gain more confidence on its correct functionality by giving it a test of its own.To create a test fixture and an expected result to compare to, it is essential to understand what the method is actually supposed to do. In trying that, I found that it has redundant loops and variables defined in several places that at least make it hard to read (see my comments here; the code appears to be adapted from a more generally applicable algorithm, but has lost its wider applicability anyway due to the adaptations).
I mostly grasped its functionality by now, but still don't really understand the special role of the
z
dimension given to it by the above mentioned methods it's used by. Other than that, here's what so far I foundCouplingAnalysis.get_nearest_neighbors()
to be currently doing:Still not sure if that's what it is supposed to be doing though. Probably the referenced papers Kraskov (2004) and Runge (2012b) should be consulted.
The text was updated successfully, but these errors were encountered: