Topics
The rank of a matrix is an estimate of the number of linearly independent rows or columns in the matrix. It is denoted as . The rank provides an intuition about the dimensionality of the vector space spanned by the vectors within the matrix:
- a rank of 1 suggests the vectors span a line
- a rank of 2 suggests they span a plane, etc
The rank is typically estimated numerically, using the Singular-Value Decomposition (SVD).
The rank indicates the number of linearly independent directions within the matrix, not necessarily the number of dimensions of the matrix itself
from numpy.linalg import matrix_rank
A0 = np.zeros((3,3))
r0 = matrix_rank(A0) # 0
A1 = np.array([[1,2,3],
[1,2,3],
[1,2,3]])
r1 = matrix_rank(A1) # 1
A2 = np.eye(3)
r2 = matrix_rank(A2) # 3