From: Bruno Luong on 4 Oct 2009 06:14 "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <ha9rl7$gej$1(a)fred.mathworks.com>... > > Only now should you rescale b to compensate for the > prior scaling of x. > > format long g > b(2) = b(2) * 1e73 > b = > 4.93457076016252 Of course, John meant divided b(2) is a correct rescaling. Bruno
From: John D'Errico on 4 Oct 2009 06:44 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <ha9sh9$l13$1(a)fred.mathworks.com>... > "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <ha9rl7$gej$1(a)fred.mathworks.com>... > > > > > Only now should you rescale b to compensate for the > > prior scaling of x. > > > > format long g > > b(2) = b(2) * 1e73 > > b = > > 4.93457076016252 > > > Of course, John meant divided b(2) is a correct rescaling. > > Bruno What is a little factor of 1e73 one way or the other among friends anyway? John
From: Tim Davis on 4 Oct 2009 08:06 See my FACTORIZE code; it's very easy to use. Also, posting a matrix with 5 digits of accuracy isn't a good idea. It's too long for anyone to read, and even if someone wants to reconstruct your problem, they can't because you've tossed out about 11 digits in each number (which is where the problem may lie). And you should never (well, almost never) do x=(A'*A)\(A'*b) to solve a least squares problem. The only time you should do that is if you know your data is very well conditioned (not this case), and if A\b is slower than you'd like. Cholesky on the normal equations can be faster than QR on A ... but of course that's useless if A'*A is horribly conditioned. (The condition number of A'*A is the square of the condition of A, so if cond(A) is 1e8 you could hope to get 8 digits of accuracy in your result. But cond(A'*A) is 1e16, so you get nothing in the result.)
From: Bruno Luong on 4 Oct 2009 08:26 "Tim Davis" <davis(a)cise.ufl.edu> wrote in message <haa339$1tk$1(a)fred.mathworks.com>... > And you should never (well, almost never) do x=(A'*A)\(A'*b) to solve a least squares problem. Right, but what you could do is x = (A'*A + L'*L) \ (A'*b) where L is appropriate Tikhonov matrix. In the standard form L could be sqrt(lambda)*speye(n). It is anyway dangerous not using any kind of regularization while solving system involving a ill-conditioned matrix (it is *not* the case of OP's problem, since the problem he had is simply due to a bad scaling). Bruno
From: Dave on 4 Oct 2009 09:08 How about: invX = X\eye(size(X)); Dave
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: Contour maps Next: Integration of Simulink Model Compare in SVN |