# Given its pseudo-inverse, is there a fast way to measure the degree of full-rankness of a nonsquare matrix?

update: I realized the core of question is about ill-conditioning of the matrix (aka Multicollinearity). In a computer, with floating point arithmetic, it is impossible to talk about full-rankness. We can only measure the degree in which it occurs. Thus, I still have a question. Better rewritten.

I have seen in StackOverflow suggestions of dividing the biggest singular value by the smallest. Is performing an entire SVD really the fastest solution?

I am writing a software that needs to check the full-rankness of a matrix M. It makes use of a fast linear algebra library (LAPACK). Since it also needs the pseudo-inverse of the matrix, it performs Singular Value Decomposition first, to be able to calculate the rank. After that it calculates the pseudo-inverse.

However, if we measure only the SVD part of the calculation, it is already twice slower than my entire previous pseudo-inverse calculation "pinvRR" (which was based on ridge regression theory).

Can I take advantage of the pinvRR result to check if the matrix is full-rank?

• pseudo-inverse. – viyps Mar 8 '14 at 17:40
• SVD turned out to be much more stable numerically than ridge regression. – viyps Apr 10 '14 at 18:58
• You can estimate the conditional number without running SVD... – d.k.o. Apr 15 '14 at 2:04

If you are using LAPACK, it has DGECON function which estimates the reciprocal of the condition number of a real matrix in $\| .\|_1$ or $\|.\|_{\infty}$. It's a way faster than SVD and gives pretty good estimate (internally it performs LU decomposition).

• Yes I am using LAPACK via MTJ (netlib). Sounds good, I need some time to test it. Any practical considerations on how to assess the returned value are welcome. – viyps Apr 15 '14 at 17:57
• Actually, Matlab uses the same implementation. So, if you just want to check, run $rcond(A)$ (if $A$ is ill-conditioned the result will be close to 0) – d.k.o. Apr 15 '14 at 18:50