Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds weighted permutation entropy #19

Merged
merged 4 commits into from
Jun 24, 2021
Merged

Conversation

samgdotson
Copy link
Contributor

This pull request:

  1. Implements weighted permutation entropy according to Fadlallah et al. (2013)
  2. Adds corresponding, passing, tests
  3. Changes the name of CAHNGELOG.md --> CHANGELOG.md

There is already a pull request for weighted permutation entropy, however, this PR differs in the following ways

  1. Includes the time delay (tau) which is an important part of delay coordinate embedding (the previous PR neglects this).
  2. Includes appropriate tests (the previous PR neglects this).
  3. This implementation does not use a hashmap.

The time performance for this implementation is good (not perfect), but can still calculate PE for an arbitrarily high embedding dimension.

Time performance test:

%%timeit
time = np.linspace(0, 100, 10000)
data = np.cos(time)
m = 20
tau = 2
hw = wpe(data, order=m, delay=tau, normalize=True)
hw

>>> 148 ms ± 906 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #19 (0aa4c37) into master (704e919) will increase coverage by 1.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   91.79%   92.81%   +1.01%     
==========================================
  Files           2        2              
  Lines         134      153      +19     
==========================================
+ Hits          123      142      +19     
  Misses         11       11              
Impacted Files Coverage Δ
pyentrp/entropy.py 90.26% <100.00%> (+1.48%) ⬆️
tests/test_entropy.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 704e919...0aa4c37. Read the comment docs.

@nikdon
Copy link
Owner

nikdon commented Jun 24, 2021

Hey. Sorry for the delay in communication. Thank you for the PR. I'll merge it and prepare a new release shortly

@nikdon nikdon merged commit 9d63700 into nikdon:master Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants