Open Marius1311 opened 4 years ago
What are you using as eta here? The uniform distribution or something else? Differently asked: does X.T.dot(X) behave well?
Another question: You say that you have "5 recurrent and a number of transient states". This is a little bit confusing to me, since a state is either transient or recurrent (to be perfectly precise: a state is either transient, positive recurrent or null recurrent). Since you say that your matrix is huge, I'm confused that you seem to only have a few states at all (5 recurrent plus a few transient ones). Shouldn't every state of your many (thousands?) states be either recurrent or transient? Also: How did you identify (technically) that your matrix is reducible and how did you characterize the states as recurrent or transient?
Could you mb. provide me with the matrix?
What are you using as eta here? The uniform distribution or something else? Differently asked: does X.T.dot(X) behave well?
I'm using the uniform distribution.
What are you using as eta here? The uniform distribution or something else? Differently asked: does X.T.dot(X) behave well?
I'm using the uniform distribution.
Hm, ok... thus it should work - there is no theoretical justification for your problem. Reducible matrices have a Schur decomposition too. You will have multiple eigenvalues equal 1, but this is no problem. From the transient states several eigenvalues at zero will result, thus the matrix won't have full rank, but this also shouldn't be a problem...
Another question: You say that you have "5 recurrent and a number of transient states". This is a little bit confusing to me, since a state is either transient or recurrent (to be perfectly precise: a state is either transient, positive recurrent or null recurrent). Since you say that your matrix is huge, I'm confused that you seem to only have a few states at all (5 recurrent plus a few transient ones). Shouldn't every state of your many (thousands?) states be either recurrent or transient? Also: How did you identify (technically) that your matrix is reducible and how did you characterize the states as recurrent or transient?
Sorry, I could have been more precise here. I meant that I have 5 recurrent classes, some of which only contain one state, i.e. are absorbing, see Fig 1 below. The remaining states are distributed across transient classes, I have 602 different transient classes, most of which only contain a single state. The largest transient class contains ~1.5k states. To compute recurrent and transient classes, I use this function in CellRank: https://github.com/theislab/cellrank/blob/040e758b3c1736d64c8ce9e29b2cc2ed198d0916/cellrank/tools/_utils.py#L694
I will send you the matrix via email.
Matrix send!
Update from Matlab side:
The problem was not reproducible in Matlab: When sorting the top ten eigenvalues up and afterwards checking X.T*X for e.g. the 5 top Schurvectors (associated to 5 degenerated ones), the result was perfect orthogonality... subspace was in the range of 1e-15 too... Even clustering in e.g. 5 states worked perfectly - the vectors constituted a perfect simplex. Chi's looked fine too.
Conclusion:
Let's do the merge of request 3 (just change the tolerance to 2*eps here) and then try it again: The problem must be somewhere inside our code or in the scipy Schur routines... Something you could try: perform sorting of Q, R with Brandts once, afterwards sort the already sorted Q, R again with Brandts and check for changes... Have you tested the same matrix using Krylov? Any problems there?
Hi @msmdev , thanks for the update! Will look into the re-sorting with Brandts
I tried this both with krylov and brands, see above, same result.
Hi @msmdev , I have a large, reducible matrix with 5 recurrent and a number of transient states. I run GPCCA on it, both with method
brandts
as well askrylov_schur
. In both cases, I get the following error:The deviations from the unit matrix are quite large (~1e-1), so this is not a tolerance problem. Would you expect the current implementation to run on reducible matrices? I remember you had some handling for this case in PCCA.