[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:35:53 +0200 |
On Mon, Jun 30, 2008 at 11:31 PM, Vic Norton <address@hidden> wrote:
>
> On Jun 30, 2008, at 5:16 PM, Jaroslav Hajek wrote:
>
>>> 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".
>
> What is the "precision" of "pinv"? If your data only is accurate to 6
> digits, why try for anything more accurate than svdcut = 1e-7 would produce?
> Any additional "accuracy" is pure noise.
>
OK, that's what the second argument (TOL) is for. It's true, however,
that it would perhaps be more useful to specify a relative rather than
absolute threshold.
> Regards,
>
> Vic
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- Re: QR vs LU factorisation, (continued)
Re: QR vs LU factorisation, Ben Abbott, 2008/06/29
Re: QR vs LU factorisation, Vic Norton, 2008/06/30