-
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
Extracting pieces of a AbstractRecurrenceMatrix #118
Comments
Hi there, it is really simple to fix this. You can do a Pull Request to RecurrenceAnalysis.jl that implements the following method: Base.getindex(R::RecurrenceMatrix, args...) = RecurrenceMatrix(getindex(R.data, args...)) this will transform the sub-selection into a type |
Naturally we should make the function a bit more detailed, so that it checks that your sub-selection is still a square matrix, but other than that, that's about it. |
@heliosdrm actually, we could consider the possibility of allowing recurrence matrices to store views of the data, similarly with how we did for |
Agreed, we can consider it, although there are some decisions to make about it:
|
|
The inconsistency would only happen for
And in addition: provide a cheap way to make a CrossRecurrenceMatrix(R::AbstractRecurrenceMatrix{T}) where T = CrossRecurrenceMatrix{T}(R.data) Thus, if I want a view of a @view CrossRecurrenceMatrix(R)[rows, columns] |
Yeap all great ideas 👍 |
Unfortunately, not that easy. The data inside recurrence matrices are sparse matrices, and some methods use specific functions for such matrices, like Related discussions in Discourse: So, maybe using |
thanks for having a look. Alright, it's not that bad honestly. The copy operation should probably be insignificant in performance compared to actually computing RQA measures. |
Hello there. I am working in a new way to calculate some RQA quantifiers and, for this purpose, I need to extract some smaller sets of the Recurrence Matrix (RM). I have implemented this in my own code, however I would like to integrate it with DynamicalSystems to use its high speed. In my code, I have defined a RecurrencePlot (RP) as a
Array{Bool, 2}
and, hence, extracting a smaller block reduces toRP[1:3, 1:3]
(for example). Thus, I was expecting that something likeRM = RecurrenceMatrix(mapp, e)
micro = RM[1:3, 1:3]
would return
micro
as the same type ofRM.
However, when I do this, I get:typeof(micro) >> SparseArrays.SparseMatrixCSC{Bool,Int64}
And this does not allow me to use
determinism(micro)
, for the RQA quantifiers only accept::AbstractRecurrenceMatrix
. Hence, I looked for the documentation of::AbstractRecurrenceMatrix
to see whether I could somehow get mymicro
to be the same type asRM
, but this search was unsuccessful. Is there a way to do this or could this feature somehow be implemented?It has occured to me that I could get the variable
micro
the way I want if I do the following:micro = CrossRecurrenceMatrix(mapp[1:3], mapp[1:3], e)
However this implies that the whole calculation of the matrix will be made every single time and I was looking for a simpler way to do this, such as the one I mentioned or, at least, not as expensive computationally. I also realize the
@windowed
macro does something of the fashion, but not quite what I need.The text was updated successfully, but these errors were encountered: