-
Notifications
You must be signed in to change notification settings - Fork 12
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
Lazy RecurrenceMatrix to compute certain rqa metrics #166
Comments
Hi, So if I understand correctly you use the same In any case, what you propose here makes perfect sense to me. This If I understood correctly however, your implementation for the |
I can confirm George's guess. It should only work for fixed threshold. Therefore, I would not call it an "improved" or "refined" algorithm. It is just a different algorithm which works fine in specific use cases (like the other implementation is fine for other use cases). Thanks for your contribution! |
Yes, our current implementation would only work for a fixed threshold, and I haven't looked into the other threshold computations whether they could also be done lazily. I would throw the error at the initialisation of the LazyRecurrenceMatrix if the indicated threshold could not be computed lazily and hint to using RecurrenceMatrix instead. We had some inital tests that our version of tau_recurrence gives the same tau_recurrence values as when we computed the RecurrencePlot eagerly and take the tau_recurrence then. The "improved/refined algorithm" was only for our very specific use case and only in terms of memory and computation costs and I had the plots still laying around... |
that sounds fine to me, feel free to make a PR whenver you have the time! |
Describe the feature you'd like to have
We are using RecurrenceAnalysis.jl for computing the RQA Trend to detect changes in satellite time series.
When we upscaled this to larger areas ( meaning more time series) we found that a lot of time was spent in garbage collection and that a lot of the allocations are coming from the construction of the sparse recurrence matrix.
When we switched the algorithm to compute the tau_recurrence directly from our input time series we got a huge improvement in the number of allocations and thereby also in the timing of the RQA Trend computation.
This is the performance and memory consumption from saving the RecurrenceMatrix and then computing the Trend versus computing the tau_recurrence in one sweep and then computing the trend from there.
These are the compared functions:
And this is the number of allocations:
If possible, sketch out an implementation strategy
This is our implementation of the
tau_recurrence
function:I am envisioning to have a LazyRecurrenceMatrix type which would just keep the input vector and the arguments for the RecurrenceMatrix computation but where the actual matrix would not be immidiately computed but where the tau_recurrence would be computed like above.
I would be happy to provide a PR if you think this would be a useful addition to RecurrenceAnalysis.jl
The text was updated successfully, but these errors were encountered: