|
From: | Fredrik Lingvall |
Subject: | Re: Problem of polyfit |
Date: | Fri, 07 Oct 2005 14:41:17 +0200 |
User-agent: | Mozilla Thunderbird 1.0.6 (X11/20051004) |
Tetsuro KURITA wrote:
OK. Then X'*X do not have full rank (i.e., som eigenvalues are very small) and the inverse do not exist.On 2005/10/07, at 17:32, Fredrik Lingvall wrote:Can you post the output of norm( inv(X'*X)*X'*y - (X'*X)\X'*y )?The result is as follows. octave> norm(inv(X'*X)*(X'*y) - (X'*X)\(X'*y)) warning: matrix singular to machine precision, rcond = 3.02246e-112 warning: attempting to find minimum norm solution ans = 50.504 When calculating (X'*X)\(X'*y), warning message raise. ======================================================= Tetsuro KURITA E-mail: address@hidden =======================================================
Try for example, [U,D,V] = svd(X'*X); semilogy(diag(D));You will probably see that some singular values are very close to zero and a direct inverse of
X'*X will result in strong noise amplification. Fredrik ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |