mdentropy icon indicating copy to clipboard operation
mdentropy copied to clipboard

TEnt of discrete variable timeseries. Added example.

Open evanfeinberg opened this issue 8 years ago • 5 comments

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.

evanfeinberg avatar Sep 03 '16 03:09 evanfeinberg

Not sure why it failed, the same exact test (test_adaptive()) works fine on vsp-compute.

In [17]: entropy(None, RNG, 'grassberger', a, b) Out[17]: 3.6577128186414978

In [13]: TRUE_ENTROPY
Out[13]: 3.2928770664093454

that's within the tolerance.

evanfeinberg avatar Sep 03 '16 04:09 evanfeinberg

Not sure why it failed, the same exact test (test_adaptive()) works fine on vsp-compute.

It's been finicky, don't worry.

cxhernandez avatar Sep 07 '16 20:09 cxhernandez

~~Could you make the example a python notebook when you get a chance?~~

I'm adding docs in https://github.com/msmbuilder/mdentropy/pull/46

Update: I've made an example for mutual information. So no need to worry about it.

cxhernandez avatar Sep 07 '16 20:09 cxhernandez

Also, just a reminder to add the other bugfix you had (no rush!)

cxhernandez avatar Sep 08 '16 15:09 cxhernandez

Just a heads up that #46 has been merged, so we'll have to rebase this.

cxhernandez avatar Sep 22 '16 19:09 cxhernandez