# [Numpy-discussion] Rank deficient matrices

Paul F. Dubois paul at pfdubois.com
Tue Oct 30 07:21:07 EST 2001

Use LinearAlgebra.singular_value_decomposition

-----Original Message-----
[mailto:numpy-discussion-admin at lists.sourceforge.net] On Behalf Of Nils
Wagner
Sent: Tuesday, October 30, 2001 12:24 AM
To: numpy-discussion at lists.sourceforge.net
Subject: [Numpy-discussion] Rank deficient matrices

Hi,

Let us assume that

r = rank(C) < N               (1)

where C is a symmetric NxN matrix. This implies that the number of
non-zero eigenvalues of C is r. Because C is a symmetric matrix there
exists an orthogonal matrix U whose columns are the eigenvectors of C
such that

U^\top C U = [ d , O
O , O].         (2)

In the above equation d \in rxr is a diagonal matrix consisting of only
the non-zero eigenvalues of C. For convenience, partition U as

U = [U_1 | U_2]                (3)

where the columns of U_1 (Nxr) are the eigenvectors corresponding to the
non-zero block d and the columns of U_2 are the eigenvectors
corresponding to the rest
(N-r) number
of zero eigenvalues.

Defining a rectangular transformation matrix

R = U_1                        (4)

it is easy to show that

R^\top C R = d.                 (5)

Therefore, the matrix R in equation (4) transforms the originally rank
deficient matrix C to a full-rank (diagonal) matrix of rank r.

I am looking for an efficient Numpy implementation of this
transformation.