pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

Fix of double counting errors #103

Closed aodenweller closed 5 years ago

aodenweller commented 6 years ago

The current implementation does not handle double countings correctly. This can quickly be reproduced for event series with events on alternating days. E.g. EventSeriesX = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0] EventSeriesY = [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1] produces an output of (0.83333333333333337, 1.0) which after the summation of both synchronisation rates is not normalised to the [0,1] interval anymore. This is because events are counted twice due to the less or equal sign in both directions. To fix this, we have to check for all synchronised event pairs if at least one event of the pair is also synchronised in the other direction. For a given event pair, this can be done by looking at possible synchronisations in both columns and rows of the matrix of the other direction. If any double countings are detected, the corresponding event pairs are only counted as 0.5 so that the normalisation works properly again.

aodenweller commented 6 years ago

Alternatively, one could also simply replace the smaller or equal sign with a smaller sign when comparing the interevent differences with tau. Then however, the example from above would yield no synchronization at all, which isn't a good option in my opinion.

ntfrgl commented 5 years ago

Included in #119.