[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: QR vs LU factorisation
From: |
Jaroslav Hajek |
Subject: |
Re: QR vs LU factorisation |
Date: |
Mon, 30 Jun 2008 23:16:44 +0200 |
On Mon, Jun 30, 2008 at 10:32 PM, Vic Norton <address@hidden> wrote:
> Hi Jordi,
>
> I doubt that QR is any better than LU if the matrix is very poorly
> conditioned.
Not plain QR, but pivoted QR usually is.
> 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.
or just use "pinv".
>
> 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
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
Re: QR vs LU factorisation, Ben Abbott, 2008/06/29
Re: QR vs LU factorisation, Vic Norton, 2008/06/30
- Re: QR vs LU factorisation,
Jaroslav Hajek <=