help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QR vs LU factorisation


From: Vic Norton
Subject: Re: QR vs LU factorisation
Date: Mon, 30 Jun 2008 16:32:01 -0400

Hi Jordi,

I doubt that QR is any better than LU if the matrix is very poorly conditioned. SVD is the best solution in this case. For example, to invert a matrix A choose an svd "precision", say

   svdcut = 1e-12;

Then do

   [U S V] = svd(A, 1);
   sig = diag(S);
   rnk = 0;
   for i = 1 : length(sig)
      if sig(i)/sig(1) < svdcut; break; endif
      rnk++;
   endfor
   Ainv = ( V(:, 1:rnk) * diag(1 ./ sig(1:rnk)) ) * U(:, 1:rnk)';

to get the (pseudo)inverse of A.

Regards,

Vic


On Jun 29, 2008, at 2:24 PM, Jordi Gutiérrez Hermoso wrote:

This isn't specifically an Octave question except tangentially.

I have some matrices that are as bad as can be: largish (1000x1000 or
so), full, unsymmetric, and ill-conditioned. I notice that Octave uses
LU factorisation with partial pivoting to invert these matrices as a
last resort, which has been giving me acceptable results. Someone
suggested to me that QR factorisation would be better suited. I'm
reading Golub & Van Loan, but see no clear indication of when to use
QR or LU.

Does anyone have any suggestions?

Thanks,
- Jordi G. H.
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave




reply via email to

[Prev in Thread] Current Thread [Next in Thread]