Re: linalg[leastsqrs] in Maple V R4



That explains a lot.

In my 72 x 9 problem, the 9x9 matrix transpose(u)&*u is not
singular--linalg[rank] returns 9--but it is illconditioned, with the
linalg[cond] returning something of the order of 5.2E11, which is huge.
No wonder why I need to set Digits to much higher than my desired
precision to get consistent results!

For some reason I thought that linalg[leastsqrs] would've used an SVD
algorithm, but from what you tell me I guess not. Press et al. in
Numerical Recipes sec. 5.13 prescribe an SVD approach for the very kind
of least squares problem I am working with. I think I can see why now.

Thanks so much for the feedback.

Les




Robert Israel wrote:

It would be nice to know more about u and bb, but I think this is
what is happening: leastsqrs works by solving the system
(u^T u) x = u^T bb. I suspect that your matrix u^T u is
ill-conditioned (or perhaps singular), which can cause
numerical problems here. Using Svd, as you have done,
should work better.

I thought that the LinearAlgebra routine LeastSquares was more
sophisticated, but an experiment showed that this is not
necessarily the case. On the other hand, in LinearAlgebra
you can use the pseudoinverse (obtained in LinearAlgebra as
MatrixInverse(..., method=pseudo)) and obtain good results.

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

.



Relevant Pages

  • Re: pseudoinverse
    ... the numerical recipes code scale S differently? ... but not scilab and numerical receipe's ... > What u write is correct but i've tried to compute the SVD ... >> denotes the hermitian of V (complex cojugate transpose). ...
    (comp.lang.fortran)
  • Re: LSA (latent sematic analysis) in Lisp, or at least SVD
    ... r> Why would you want a CL implementation of SVD? ... i'm now using Armed Bear Common Lisp that can easily FFI only Java. ... I cannot speak for SVD in particular, but "numerical recipes" is ... I am always happier getting my matrix factorizations from ...
    (comp.lang.lisp)
  • Re: pseudoinverse
    ... What u write is correct but i've tried to compute the SVD ... with scilab and with the code provided by numerical recipes ... In both the cases A=U S transposebut the calculation of the pinv is different in my code and in scilab (correct) ... the SVD single value decomposition which i have already computed. ...
    (comp.lang.fortran)