QR vs LU factorisation
Fredrik Lingvall
fredrik.lingvall at gmail.com
Tue Jul 1 03:41:24 CDT 2008
Vic Norton 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.
>
>
>
What type of problem is this about? If it is parameter estimation from
noisy data then you can't really speak about an "inverse" but you can
formulate the problem as an inference problem (e.g., find the most
likely estimate given your data and background info (noise variance etc.).
/Fredrik
More information about the Help-octave
mailing list