|
From: | Ben Abbott |
Subject: | Re: Least Absolute Deviation solution of a linear system |
Date: | Sat, 24 Jan 2009 22:38:19 -0500 |
On Jan 24, 2009, at 11:03 PM, address@hidden wrote:
Quoting "James R. Van Zandt" <address@hidden> (Thu, 22 Jan 2009 21:17:49 -0500):Octave has a function ols which find the least squares solution of anoverdetermined linear system. I propose the following function, whichfinds the "least abolute deviation" solution - the one that minimizes the sum of the absolute values of the deviations. It is more work to find (requiring solution of a linear program), but is more robust to outliers. See below for references. The LAD solution is the analog of the median. You will recall thatthe median of an odd number of values is well defined, but for an evennumber of values we normally add a condition so we get the center of the interval between the centermost values. This implementation of the LAD does not have this kind of rule. If there is more than one solution that minimizes the sum of absolute values of the deviations, it doesn't attempt to return the "middle" one. - Jim Van Zandt
Hi All,just to say that I tested (summarily) James' olad() function w/ Octave 3.0.3 and it worked fine. Should it go to octave, or octave- forge?Cheers, Etienne
Personally, I'd like to have this contribution be included in Octave's core (optimization).
However, the code needs some work to be compliant with Octave's standard.
http://wiki.octave.org/wiki.pl?StandardsMFiles Specifically ... * put spaces after commas and before open parenthesis * spaces surrounding equals For example ...
Aeq=[A eye(ra) -eye(ra)]; CHI=zeros(ca,cy);
should be
Aeq = [A, eye(ra), -eye(ra)];
CHI = zeros (ca, cy);
It is my understanding that lowercase is preferred (?)
chi = zeros (ca, cy);
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |