[Numpy-discussion] Question on LinAlg Inverse Algorithm

Mark Janikas mjanikas at esri.com
Wed Aug 31 14:32:19 EDT 2011


When I say garbage, I mean in the context of my hypothesis testing when in the presence of perfect multicollinearity.  I advise the user of the combination that leads to the problem and move on.... 

-----Original Message-----
From: numpy-discussion-bounces at scipy.org [mailto:numpy-discussion-bounces at scipy.org] On Behalf Of Bruce Southey
Sent: Wednesday, August 31, 2011 11:11 AM
To: numpy-discussion at scipy.org
Subject: Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

On 08/31/2011 12:56 PM, Mark Janikas wrote:
> Right indeed... I have spent a lot of time looking at this and it seems a waste of time as the results are garbage anyways when the columns are collinear.  I am just going to set a threshold, check the condition number, continue is satisfied, return error/warning if not.... now, what is too large?.... Ill poke around.  TY!
>
> MJ
The results are not 'garbage' as if you have collinear columns as these 
have very well-known and understandable meaning. But if you don't expect 
this then you really need to examine how you are modeling or measuring 
your data because that is where the problem lies. For example, if you 
are measuring two variables then it means that those measurements are 
not independent as you are assuming.

Bruce

> -----Original Message-----
> From: numpy-discussion-bounces at scipy.org [mailto:numpy-discussion-bounces at scipy.org] On Behalf Of Pauli Virtanen
> Sent: Wednesday, August 31, 2011 2:00 AM
> To: numpy-discussion at scipy.org
> Subject: Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm
>
> On Tue, 30 Aug 2011 15:48:18 -0700, Mark Janikas wrote:
>> Last week I posted a question involving the identification of linear
>> dependent columns of a matrix... but now I am finding an interesting
>> result based on the linalg.inv() function... sometime I am able to
>> invert a matrix that has linear dependent columns and other times I get
>> the LinAlgError()... this suggests that there is some kind of random
>> component to the INV method.  Is this normal?
> I suspect that this is a case of floating-point rounding errors.
> Floating-point arithmetic is inexact, so even if a certain matrix
> is singular in exact arithmetic, for a computer it may still be
> invertible (by a given algorithm). This type of things are not
> unusual in floating-point computations.
>
> The matrix condition number (`np.linalg.cond`) is a better measure
> of whether a matrix is invertible or not.
>

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion at scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list