mdentropy
mdentropy copied to clipboard
TEnt of discrete variable timeseries. Added example.
In this PR, we add the ability to directly compute transfer entropy with timeseries containing discrete random variables or, equivalently, continuous data that has been pre-binned. This has been accomplished by adding a n_bins=None
to entropy()
. If n_bins=None
, entropy()
will compute counts
with numpy.bincount()
, which will directly count the frequency of each discrete label for each variable. This functionality is added at a higher level to ncmutinf()
, which gives the option of passing int
timeseries and n_bins=None
, which will then compute Transfer Entropy in the way described above.
In addition, an example has been added in an examples
folder demonstrating a usage of the above and generally how to flexibly use the MDEntropy
API.