This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
gsl_multifit_linear fails in a certain case
- From: Patrick Alken <patrick dot alken at colorado dot edu>
- To: gsl-discuss at sourceware dot org
- Date: Mon, 19 Nov 2007 23:07:32 -0700
- Subject: gsl_multifit_linear fails in a certain case
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.