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

Analysing time-series data #78

Open
wxmerkt opened this issue Jul 8, 2019 · 6 comments
Open

Analysing time-series data #78

wxmerkt opened this issue Jul 8, 2019 · 6 comments

Comments

@wxmerkt
Copy link

wxmerkt commented Jul 8, 2019

Hi guys,
Thank you very much for your hard work in developing and maintaining this excellent tool - it really is a breeze to work with!

We are currently working on problems involving time-series data (trajectories). In order to achieve this, we post-process the distance matrix D to set the distance between subsequent points (t and t+1) to 0. This works just fine with dense filtration and we obtain the results that we expect. With sparse/approximate filtration, however, this breaks (maybe because the 0 to be interpreted as a sparse entry?). As our datasets usually are larger than the synthetic ones we used to test, ripser.py often runs out of memory and we'd like to leverage the approximate filtration. Do you have any advice or perhaps best practices for dealing with time-series data and approximate filtration?

Thank you very much,
Wolfgang

@ctralie
Copy link
Member

ctralie commented Jul 8, 2019 via email

@wxmerkt
Copy link
Author

wxmerkt commented Jul 8, 2019

Hi Chris,
Thank you very much for your quick response - I will try it (we have previously used 1e-6 instead of zero, and it only worked so-so). Do you mind sharing what approaches you use to represent trajectories when passing them to ripser.py?

Thank you very much - best,
Wolfgang

@ctralie
Copy link
Member

ctralie commented Jul 8, 2019 via email

@VladimirIvan
Copy link

Hi both,
I have encountered a similar issue with the missing entries in a sparse matrix being interpreted as inf instead of a zero.
I generated a distance matrix that has a large zero block:
Sparse Metric

The dense matrix produces the correct results at the cost of storage and probably additional computation.

I'd like to add myself as another future user of the feature to optionally to treat the undefined elements of a sparse matrix as zero.

Best,
Vladimir

@ulupo
Copy link
Contributor

ulupo commented Aug 21, 2020

@wxmerkt a bit late to the party here but, in my experience, things work out as I think you would like them to in ripser.py if you explicitly store zeros in your sparse matrices (this can be done in a number of scipy sparse formats, though not in all). I can show you an example if you like (perhaps this got solved in the meantime?).

When making pyflagser (docs), we had to face some similar conundrums concerning the expected format of sparse matrices. In the end, we settled for a design choice which is explained in the function flagser_weighted -- analogous to ripser (it computes the same persistence diagrams when directed=False is passed!). In brief, you can pass sparse adjacency matrices with explicitly stored zeros and they are treated as zero filtration parameters, not as absent edges. The absent edges, as @ctralie pointed out is the case also in ripser.py, are the non-stored entries in the sparse matrix (the "sparse zeros", if you will). But again, I think ripser.py does the same thing!

@ctralie
Copy link
Member

ctralie commented Aug 21, 2020 via email

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

No branches or pull requests

4 participants