I have a question related to linear function estimation. Suppose the potential line function model can be expressed as ax+by+c=0, where a, b, c are the unknown parameters that needed to be estimated. Now a set of data is given (x1,y1), (x2, y2), ... (xn, yn), and we want to make use of these data to estimate the parameters. As outliers (points that are not suited for model estimation) may exist in this data set, one way to avoid outliers is to minimize sum(abs(a*xi+b*yi+c)) (i=1,2, ..., n). However, I could not figure out how to minimize this function step by step, could anyone give me some clues? Thanks!
|
|
|||
migrated from stackoverflow.com Sep 29 '12 at 0:50
|
Have you looked at L1-magic ? it's a Matlab package that contains code for solving seven optimization problems using L1 norm minimization. If I understand you correctly, you are looking for is also known as basis pursuit, a procedure that finds the vector with smallest L1 norm ||X_1|| := Sum |Xi| subject to AX = b, that explains the observations b. This can be done by implementing a primal-dual algorithm for linear programming (see S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004). A short explenation for doing this is found in section 2.1 of the L1-magic manual... |
|||
|
|
There was a great solution to this same problem posted on this CrossValidated previously: L1 minimization cast as linear programming, that you can implement yourself. |
|||
|
|
|
Let
Then
and then
which is of the form
and you are doing a simple fit to a straight line. The standard technique for doing this is least squares, which minimizes the mean squared error (the L2 norm). Google "least squares Matlab". The L2 norm is used, instead of the L1 norm, because the L2 norm is everywhere differentiable. The L1 norm is not, making minimization, which involves the derivative of the error function, problematic. |
|||||||
|
polyfit– Batsu Sep 27 '12 at 16:25