[Numpy-discussion] Identifying Colinear Columns of a Matrix

Mark Janikas mjanikas@esri....
Fri Aug 26 12:12:20 CDT 2011


As you will note, since most of the functions work on rows, the matrix in question has been transposed.

From: numpy-discussion-bounces@scipy.org [mailto:numpy-discussion-bounces@scipy.org] On Behalf Of Mark Janikas
Sent: Friday, August 26, 2011 10:11 AM
To: 'Discussion of Numerical Python'
Subject: [Numpy-discussion] Identifying Colinear Columns of a Matrix

Hello All,

I am trying to identify columns of a matrix that are perfectly collinear.  It is not that difficult to identify when two columns are identical are have zero variance, but I do not know how to ID when the culprit is of a higher order. i.e. columns 1 + 2 + 3 = column 4.  NUM.corrcoef(matrix.T) will return NaNs when the matrix is singular, and LA.cond(matrix.T) will provide a very large condition number.... But they do not tell me which columns are causing the problem.   For example:

zt = numpy. array([[ 1.  ,  1.  ,  1.  ,  1.  ,  1.  ],
                           [ 0.25,  0.1 ,  0.2 ,  0.25,  0.5 ],
                           [ 0.75,  0.9 ,  0.8 ,  0.75,  0.5 ],
                           [ 3.  ,  8.  ,  0.  ,  5.  ,  0.  ]])

How can I identify that columns 0,1,2 are the issue because: column 1 + column 2 = column 0?

Any input would be greatly appreciated.  Thanks much,

MJ

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110826/ee03ab6c/attachment.html 


More information about the NumPy-Discussion mailing list