Comments (3)
Thank you for pointing out the potential "IndexError" in the compute_PTE function. I understand the concern about the non-square nature of P_y_x and the possibility of an index mismatch.
The current approach of using the .max() method to determine the size of the arrays might be a source of this error, especially when there's missing data in the sequences. I'll be looking into more reliable ways to set the array dimensions to avoid such indexing issues.
Regarding the delay estimation, while it's a broader concern, I'll take your feedback into consideration and evaluate its potential impact on the accuracy and reliability of the entire procedure.
To help me better diagnose and fix the issue, could you please provide some test data that reproduces the behavior you described?
from pypte.
a quick fix would be to ensure that the matrix P_y_x is square
max_dim = max(y.max(), x.max()) + 1
P_y_x = np.zeros([max_dim, max_dim])
np.add.at(P_y_x, [y, x], 1)
I cannot guarantee the correctness of the algorithm at the moment, though.
Checkout this branch: https://github.com/patrk/pyPTE/tree/12-indexerror where I applied this quick fix and let me know if it helps. #
from pypte.
I deem the fix as suitable after some testing and incorporated it in the recent refactoring.
from pypte.
Related Issues (17)
- Dimensions switched in documentation of code HOT 2
- Divide by zero in entropy calculations HOT 7
- Raise awareness on delay calculation HOT 1
- Raise awareness on issues and drawbacks by examples HOT 2
- Make use of numpy iterators in PTE calculation
- Update Readme, Documentation, gh-pages
- Publish code on PyPi
- Is get_delay correct? HOT 6
- Correctness of TE calculation
- Permutation testing? HOT 2
- the definition of bin width HOT 7
- Delay Estimation Methods to Support Per-Channel Analysis and Explore More Robust Metrics
- Explore / implement more approaches to phase based TE
- Enhancements: NMM Examples, PTE Significance Testing, and More Sanity Checks
- Bug: Axes are switched HOT 8
- Semantic Release does not work in GH Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypte.