From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32465 invoked by alias); 20 Nov 2007 06:07:32 -0000 Received: (qmail 32455 invoked by uid 22791); 20 Nov 2007 06:07:31 -0000 X-Spam-Check-By: sourceware.org Received: from qmta02.westchester.pa.mail.comcast.net (HELO QMTA02.westchester.pa.mail.comcast.net) (76.96.62.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Nov 2007 06:07:27 +0000 Received: from OMTA09.westchester.pa.mail.comcast.net ([76.96.62.20]) by QMTA02.westchester.pa.mail.comcast.net with comcast id Erbu1Y0080SCNGk0508600; Tue, 20 Nov 2007 06:07:24 +0000 Received: from hippogriff.homeunix.org ([75.70.82.180]) by OMTA09.westchester.pa.mail.comcast.net with comcast id Eu7Q1Y0063tRyZn0300000; Tue, 20 Nov 2007 06:07:24 +0000 X-Authority-Analysis: v=1.0 c=1 a=kWzvHc6BHQQA:10 a=vSSX3dyQot88NmFuah0A:9 a=q_ChE-wycOz8UiE6LyKFgLeD4-gA:4 a=XF7b4UCPwd8A:10 Received: by hippogriff.homeunix.org (Postfix, from userid 1000) id 1E69ED8B3; Mon, 19 Nov 2007 23:07:32 -0700 (MST) Date: Tue, 20 Nov 2007 06:07:00 -0000 From: Patrick Alken To: gsl-discuss@sourceware.org Subject: gsl_multifit_linear fails in a certain case Message-ID: <20071120060732.GB8438@hippogriff.physics.drexel.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00031.txt.bz2 This post is a continuation of a discussion on help-gsl. Basically gsl_multifit_linear will fail if the following 2 conditions are met: (1) the matrix X has no inverse (ie: it has a singular value of 0 in its SVD decomp) and (2) the RHS of the fit is a zero vector In this case, we are solving the equation X c = 0 and X has no inverse, but gsl_multifit_linear still tries to compute the psuedo-inverse and fudges the zero singular value to force it to make an inverse. The result returned by the routine is c = 0 which is not the desired solution. A possible fix would be to check for a singular value of zero and if one is found, check to see if the RHS vector is 0. If it is, then don't try to compute S^{-1} but instead compute the null space of X which is the corresponding column of the matrix V. I'm not really sure what to do if there is more than one zero singular value.