A Maximum Likelihood Approach to Least Absolute Deviation Regression

Least absolute deviation (LAD) regression is an important tool used in numerous applications throughout science and engineering , mainly due to the intrinsic robust characteristics of LAD. In this paper, we show that the optimization needed to solve the LAD regression problem can be viewed as a sequence of maximum likelihood estimates (MLE) of location. The derived algorithm reduces to an iterative procedure where a simple coordinate transformation is applied during each iteration to direct the optimization procedure along edge lines of the cost surface, followed by an MLE of location which is executed by a weighted median operation. Requiring weighted medians only, the new algorithm can be easily modularized for hardware implementation, as opposed to most of the other existing LAD methods which require complicated operations such as matrix entry manipulations. One exception is Wesolowsky's direct descent algorithm, which among the top algorithms is also based on weighted median operations. Simulation shows that the new algorithm is superior in speed to Wesolowsky's algorithm, which is simple in structure as well. The new algorithm provides a better tradeoff solution between convergence speed and implementation complexity. 1. INTRODUCTION Linear regression has long been dominated by least squares (LS) techniques, mostly due to their elegant theoretical foundation and ease of implementation. The assumption in this method is that the model has normally distributed errors. In many applications, however, heavier-than-Gaussian tailed distributions may be encountered, where outliers in the measurements may easily ruin the estimates [1]. To address this problem, robust regression methods have been developed so as to mitigate the influence of outliers. Among all the approaches to robust regression, the least absolute deviations (LADs) method, or L 1-norm, is considered conceptually the simplest one since it does not require a " tuning " mechanism like most of other robust regression procedures. As a result, LAD regression has drawn significant attentions in statistics, finance, engineering, and other applied sciences as detailed in a series of studies on L 1-norm methods [2, 3, 4, 5]. LAD regression is based on the assumption that the model has Laplacian distributed errors. Unlike the LS approach though, LAD regression has no closed-form solution, hence numerical and iterative algorithms must be resorted to.


INTRODUCTION
Linear regression has long been dominated by least squares (LS) techniques, mostly due to their elegant theoretical foundation and ease of implementation. The assumption in this method is that the model has normally distributed errors. In many applications, however, heavier-than-Gaussian tailed distributions may be encountered, where outliers in the measurements may easily ruin the estimates [1]. To address this problem, robust regression methods have been developed so as to mitigate the influence of outliers. Among all the approaches to robust regression, the least absolute deviations (LADs) method, or L 1 -norm, is considered conceptually the simplest one since it does not require a "tuning" mechanism like most of other robust regression procedures. As a result, LAD regression has drawn significant attentions in statistics, finance, engineering, and other applied sciences as detailed in a series of studies on L 1 -norm methods [2,3,4,5]. LAD regression is based on the assumption that the model has Laplacian distributed errors. Unlike the LS approach though, LAD regression has no closed-form solution, hence numerical and iterative algorithms must be resorted to.
Surprisingly to many, the LAD regression method first suggested by Boscovich (1757) and studied by Laplace (1793) predated the LS technique originally developed by Legendre (1805) and Gauss (1823) [1,2]. It was not until nearly a century later that Edgeworth [6] proposed a general numerical method to solve the unconstrained LAD problem, where the weighted median was introduced as the basic operation in each iteration. Edgeworth's method, however, suffers from cycling when data has degeneracies [7]. A breakthrough came in the 1950's when Harris [8] brought in the notion that linear programming techniques could be used to solve the LAD regression, and Charnes et al. [9] actually utilized the simplex method to minimize the LAD objective function. Many simplex-like methods blossomed thereafter, among which Barrodale and Roberts [10] and Armstrong et al. [11] are the most representative ones. Other efficient approaches include the active set method by Bloomfield and Steiger [12], the direct decent algorithm by Wesolowsky [13], and the interior point method proposed by Zhang [14]. More historical background about LAD estimate can be found in [2].
The simple LAD regression problem is formulated as follows. Consider N observation pairs (X i , Y i ) modelled in a linear fashion where a is the unknown slope of the fitting line, b the intercept, and U i are unobservable errors drawn from a random variable U obeying a zero-mean Laplacian distribution f (U) = (1/2λ)e −|U|/λ with variance σ 2 = 2λ 2 . The LAD regression is found by choosing a pair of parameters a and b that minimizes the objective function which has long been known to be continuous and convex [1]. Moreover, the cost surface is of a polyhedron shape, and its edge lines are characterized by the sample pairs (X i , Y i ).
Notably, the minimization of the LAD cost function (2) is closely related to the location estimation problem defined as follows. Let the random variable V be defined as V = U + µ, where µ is an unknown constant location and U obeys the Laplacian distribution. The maximum likelihood estimate (MLE) of location on the sample set The solution to the above minimization problem is well known to be the sample Median The striking similarity between (2) and (3) infers that, for a fixed a = a 0 , the minimizer of (2), say b * a0 , is essentially an MLE for location under the Laplacian assumption. For reasons that will be explained shortly in Section 2, the minimizer of (2) a * b0 , given b = b 0 , is also an MLE for location under the Laplacian assumption with certain extensions. Thus, a very intuitive way of solving the LAD regression problem can be constructed as a "seesaw" procedure: first, hold one of the parameters a or b constant, optimize the other using the MLE concept, then alternate the role of the parameters, and repeat this process until both parameters converge. It will soon be shown in the paper that this method suffers from some intrinsic limitations that often leads to nonglobal optimal solutions despite its attractive simplicity. However, further inspection on this initial algorithm reveals that, with some specific guidance on how to do the MLE optimization and one simple coordinate transformation, a similar but more accurate algorithm can be formulated where the global optimum can be reached. In fact, in this paper, we derive a fast iterative solution where the concept of ML is applied jointly with coordinate transformations. It is also shown that the proposed method is comparable with the best algorithms used to date in terms of computational complexity, and has a greater potential to be implemented in hardware.

Basic understanding
Consider the linear regression model in (1). If the value of a is fixed at first, say a = a 0 , the objective function (2) now becomes a one-parameter function of b: Assuming a Laplace distribution for the errors U i , the above cost function reduces to an ML estimator of location for b.
That is, we observe the sequence of random samples {Y i − a 0 X i }, and the goal is to estimate the fixed but unknown location parameter b. Thus according to (4), the parameter b * in this case can be obtained by If, on the other hand, we fix b = b 0 , the objective function reduces to Again, if the error random variable U i obeys a Laplacian distribution, the observed samples Laplacian distributed, but with the difference that each sample in this set has different variance. The reason is obvious since for each known X i and zero-mean U i , U i /X i remains a zero-mean Laplacian with variance scaled by 1/X 2 i . Thus the parameter a * minimizing the cost function (7) can still be seen as the ML estimator of location for a, and can be calculated out as the weighted median where is the replication operator. For a positive inte- When the weights |X i | are not integers, the computation of the weighted median is outlined in the appendix.
A simple and intuitive approach to the LAD regression problem is through the following iterative algorithm.
(1) Set k = 0. Find an initial value a 0 for a, such as the LS solution.
(2) Set k = k + 1 and obtain a new estimate of b for a fixed a k−1 using (3) Obtain a new estimate of a for a fixed b k using (4) Once a k and b k do not deviate from a k−1 and b k−1 within a tolerance range, end the iteration. Otherwise, go back to step (2). Since the median and weighted median operations are both ML location estimators under the least absolute criterion, the cost functions will be nonincreasing throughout the iterative procedure, that is, The algorithm then converges iteratively. Since the objective function F(a, b) is continuous and convex, one may readily conclude that the algorithm converges to the global minimum. However, careful inspection reveals that there are cases where the algorithm does not reach the global minimum. To see this, it is important to describe the relationship between the sample space and the parameter space. As shown in Figure 1, the two spaces are dual to each other. In the sample space (Figure 1a), each sample pair (X i , Y i ) represents a point on the plane. The solution to the problem (1), namely (a * , b * ), is represented as a line with slope a * and intercept b * . If this line goes through some sam- On the other hand, in the parameter space (Figure 1b), As can be seen in Figure 1, the line going through (X 1 , Y 1 ) and (X 5 , Y 5 ) in the sample space has a slope a * and an intercept b * , but in the parameter space, it is represented as a point which is the intersection of two lines with slopes (−X 1 ) and (−X 5 ), respectively. The sample set used to generate Figure 1  To better illustrate the inner topology of the function, the half surface that is towards the viewers is cut off.
The structure of the objective function F(a, b) is well defined as a polyhedron sitting on top of the a-b plane, as seen in Figure 2. The projections of the polyhedron edges onto the plane are exactly the lines defined by sample pairs (X i , Y i ), which is why the term "edge line" is used. In other words, every sample pair (X i , Y i ) has a corresponding edge line in the parameter space. Moreover, the projections of the polyhedron corners are those locations on the a-b plane, where two or more of the edge lines intersect. Most importantly, the minimum of this convex, linearly-segmented error surface occurs at one of these corners. To describe the dynamics of this simple iterative method, consider Step (2) in the procedure, where a new estimate b k is calculated based on a fixed, previously obtained a k−1 through a median operation. Since the median is of selection type, its output is always one of the inputs. Without loss of generality, assume b k = Y j − a k−1 X j , which means that the newly estimated parameter pair (a k−1 , b k ) is on the edge line defined by (−X j ) and Y j . Thus, the geometrical interpretation of Step (2) can be derived as follows: draw a vertical line at a = a k−1 in the parameter space and mark all the intersections of this line with N edge lines. 1 The intersection on the edge line defined by (−X j ) and Y j is vertically the median of all; thus its b-coordinate value is accepted as b k , the new update for b. Similar interpretation can be made for Step (3), except that the chosen intersection is a weighted median output, and there may be some edge lines parallel to the a-axis.
The drawback of this algorithm is that the convergence dynamics depends on the geometry of the edge lines in the parameter space. As can be seen in Figure 3a, the iteration is carried on between edge lines in an inefficient zigzag manner, needing infinite steps to converge to the global minimum. Moreover, as illustrated in Figure 3b

New algorithm
To overcome these limitations, the iterative algorithm must be modified exploiting the fact that the optimal solution is at an intersection of edge lines. Thus, if the search is directed along the edge lines, then a more accurate and more efficient algorithm can be formulated. The approach proposed in this paper is through coordinates transformation. The basic idea is as follows. In the parameter space, if the coordinates are transformed so that the edge line containing the previous estimate (a k−1 , b k−1 ) is parallel to the a -axis at height b k−1 , then the horizontal optimization based upon b k−1 is essentially an optimization along this edge line. The resultant (a k , b k ) will be one of the intersections that this line has with all other edge lines, thus avoiding possible zigzag dynamics during the iterations. Transforming the obtained parameter pair back to the original coordinates results in (a k , b k ). This is illustrated in Figure 4. The only requirement for this method is that the shape of the cost surface must be preserved upon transformation; thus the same optimization result can be achieved. Notice that, if an edge line is horizontal, its slope (−X j ) has to be 0. We will show shortly that a simple shifting in the sample space can satisfy the requirement.
The following is the proposed algorithm for LAD regression.
(1) Set k = 0. Initialize b to be b 0 using the LS solution Calculate a 0 by a weighted median Keep the index j which satisfies a 0 = (Y j − b 0 )/X j . In the parameter space, (a 0 , b 0 ) is on the edge line with slope (−X j ) and intercept Y j . (2) Set k = k + 1. In the sample space, right shift the coordinates by X j so that the newly formed y -axis goes through the original (X j , Y j ). The transformations in the sample space are and the transformations in the parameter space are The shifted sample space (X , Y ) corresponds to a new parameter space (a , b ), where (−X j , Y j ) represents a horizontal line. (3) Perform a weighted median to get a new estimate of a : Keep the new index t which gives a k = (Y t − b k )/X t . (4) Transform back to the original coordinates If a k is identical to a k−1 within the tolerance, end the program. Otherwise, go back to step (2).
It is simple to verify that the transformed cost function is the same as the original one using the relations in (14) and (15).
This relationship guarantees that the new update in each iteration is correct.

SIMULATIONS
The major part of the computational power of the proposed algorithm is consumed in the weighted median operation at each iteration. Essentially, it is a sorting problem, which, for n samples, is in the order of n log n. Fortunately, for this particular application, some speed-up can be achieved by not doing a full sorting every time. In [13], where the weighted median is also used as the kernel operation, a shortcut to circumvent this time-consuming full-sorting procedure is developed. The basic idea is the previous estimate can be considered close enough to the true value, thus "fine tuning" can be executed around this point by making use of the weighted median inequalities shown next in (21).
Consider a weighted median defined as follows: where the weights W i ≥ 0. If we order the samples Z i as Z (1) ≤ Z (2) ≤ · · · ≤ Z (N) , then the weight associated with the ith order statistic Z (i) is often referred to as the concomitant W [i] [15]. In this way, the weighted median a * can always be identified as Z ( j) whose index j satisfies the following inequalities: Comparing to (16), we should notice that the weights W i and samples Z i in every LAD iteration are different. Suppose that the previous estimate a k−1 , which is also the output of a weighted median, corresponds to Z j . We do not have to fully order all these samples, but classify them into two categories, the ones smaller than it and the ones larger. Check the inequalities to see if they still hold. If not, transfer the boundary sample and its weight into another group and recheck until the new weighted median output is found. Two criteria are often used to compare LAD algorithms: speed of convergence and complexity. Most of the efficient algorithms, in terms of convergence speed (except for Wesolowsky's and its variations), are derived from linear programming (LP) perspectives, such as simplex and interior point. Take Barrodale and Roberts' algorithm 2 [10], for example; its basic idea is to apply row and column operations on a constructed (N +K)×(K +1) matrix A. The initial value of A is where Y is an N × 1 vector of observations of the dependent variable and X is an N × K matrix of the independent variables. For the simple regression case, K = 2. BRlike algorithms usually consist of two phases: Phase I forms a set of independent edge direction vectors, Phase II updates the variable basis until it converges. In general, BR-like algorithms are slightly faster than other algorithms with simpler structures. Their computational complexity, however, is significantly higher. The complicated variable definition and logical branches used in BR-like algorithms cause tremendous efforts in their hardware implementations and are thus less attractive in such cases. Focusing on efficient algorithms that have a simple structure for ease of implementation, Wesolowsky's direct descent algorithm stands out. The algorithm is summarized below.
Step 1. Set k = 0. Choose the initial values a 0 , b 0 . Choose j so that |Y j − a 0 X j − b 0 | is a minimum.
Step 2. Set k = k + 1. Use the weighted median structure to get the update for b, Record the index i at which the term (Y i − Y j X i /X j )/(1 − X i /X j ) is the weighted median output.
Step 3. Step The major difference between Wesolowsky's algorithm and ours is that the weighted median operations in their case are used for intercept b updates, while in our algorithm, they are used for slope a updates. Since the realization of the weighted median in both algorithms can benefit from the partial sorting scheme stated above, to compare them, we only need to count the iteration times. Also notice that in the initialization of Step 1, there is a minimumfinding procedure, which can be considered a sorting operation thus treated as having the same order of complexity as a weighted median, even though they may be implemented with totally different structures. For this reason, this step in Wesolowsky's algorithm will be counted as one iteration. Figure 5 depicts the comparison of the newly proposed algorithm and Wesolowsky's direct descent algorithm in terms of number of iterations. It can be observed from Figure 5 that, for large sample sets, the newly proposed LAD regression method needs 5% less iterations, and about 15% less for small sample sets.

CONCLUSIONS
A new iterative algorithm for LAD regression is developed based on MLEs of location. A simple coordinate transformation technique is used so that the optimization within each iteration is carried out by a weighted median operation, thus the proposed algorithm is well suited for hardware implementation. Simulation shows that the new algorithm is comparable in computational complexity with the best algorithms available to date.

APPENDIX WEIGHTED MEDIAN COMPUTATION
The weighted median having a set of positive real weights, can be computed out as follows.