Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <brunoluong@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help with orthogonal least squares line fit with slope
Date: Fri, 14 Dec 2007 18:17:32 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <fjuhbs$5qp$1@fred.mathworks.com>
References: <8a0a561b-f3b1-4dcd-8c61-20d0fd4f7cf7@i29g2000prf.googlegroups.com>  <f8634c9c-5932-454e-a975-5ea9b0931133@t1g2000pra.googlegroups.com>
Reply-To: "Bruno Luong" <brunoluong@yahoo.com>
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 1197656252 5977 172.30.248.38 (14 Dec 2007 18:17:32 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 14 Dec 2007 18:17:32 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1184112
Xref: news.mathworks.com comp.soft-sys.matlab:442519


FWIW, the distance di of a point (xi,yi) to an horizontal
line (L): "Y=c" is di=|yi-c|. Notice this is not true if the
line L) is not horizontal. That means working on distance is
equivalent to working on algebric coordinates y for
horizontal line.

- Solution of Minimizing least-square sum(di^2) is: c=mean(yi).
- Solution of Minimizing sum(di) is: c=median(yi).
- Solution of Minimizing max({di}) is: c=(max(yi)+min(yi))/2.

Bruno