Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: inverse matrix inv pinv linfactor ginv
Date: Sun, 4 Oct 2009 12:26:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <haa48p$in7$1@fred.mathworks.com>
References: <ha8r6f$pf7$1@fred.mathworks.com> <haa339$1tk$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254659161 19175 172.30.248.38 (4 Oct 2009 12:26:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 Oct 2009 12:26:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:574782


"Tim Davis" <davis@cise.ufl.edu> wrote in message <haa339$1tk$1@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