question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Wording] Algorithm-independent definition of `matrix_rank`

See original GitHub issue

The current definition of matrix_rank is:

Computes the rank (i.e., number of non-zero singular values) of a matrix

This is strongly biased towards the SVD view of the rank, which goes against point 4 of the design principles.

Edit Note that there are other algorithms that are rank-revealing. The most important is QR with pivoting present in LAPACK, which is also sometimes used to solve lstsq. See L351-395 of LAPACK’s implementation. LU with full pivoting strategies may also be made into a rank-revealing algorithm (see this paper with +150 citations) although no large library implements them to the best of my knowledge.

A more implementation agnostic definition would be “the number of independent columns”. This gets closer into the intuition of what the rank of a linear map really is: The dimension of the image of the map.

cc @rgommers @mruberry

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
asmeurercommented, Jun 29, 2021

The rtol parameter is based on the singular values, so it’s implicit in the current specification that it would be computed that way. If there are alternate algorithms that wouldn’t be based on that, we might want to reconsider the inclusion of that parameter.

0reactions
kgrytecommented, Aug 23, 2021

During the consortium meeting on 2021-07-29, a decision was made to keep the definition of matrix_rank as is, following conventions set forth in PyData ecosystem and elsewhere (MATLAB, Julia) where the matrix rank is defined in terms of the number of singular values.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rank (linear algebra) - Wikipedia
In linear algebra, the rank of a matrix A is the dimension of the vector space generated (or spanned) by its columns. This...
Read more >
Rank of a Matrix - an overview | ScienceDirect Topics
The rank of a matrix is the maximum number of its linearly independent column vectors (or row vectors). From this definition it is...
Read more >
Matrix Rank - Stat Trek
The rank of a matrix is defined as (a) the maximum number of linearly independent column vectors in the matrix or (b) the...
Read more >
Matrix Rank - Math is Fun
The rank is how many of the rows are "unique": not made of other rows. ... Dependence means they depend on each other,...
Read more >
1. Matrix rank
(by convention, the empty set is linearly independent) recall from 133A: if a1,...,an are linearly independent m-vectors, then n ≤ m. Matrix rank....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found