Professional Documents
Culture Documents
j=1
a
ij
x
j
= b
i
, i = 1, . . . , m,
can be found by minimising the sum of the absolute errors,
m
i=1
b
i
j=1
a
ij
x
j
,
with respect to x
k
, k = 1, . . . , n. This L
1
-approximation optimisation problem is equivalent to the
following LP problem with n + m decision variables x
j
, j = 1, . . . , n, and e
i
, i = 1, . . . , m.
Minimise z =
m
j=1
e
j
subject to e
i
+
n
j=1
a
ij
x
j
b
i
, i = 1, . . . , m;
e
i
j=1
a
ij
x
j
b
i
, i = 1, . . . , m.
(a) Write down the dual problem using dual variables y
i
, i = 1, . . . , m, for the rst m constraints and
w
i
, i = 1, . . . , m, for the last m constraints. Show by eliminating the w
i
that the dual problem can
be simplied to
Maximise v =
m
i=1
b
i
y
i
subject to
m
i=1
a
ij
y
i
=
1
2
m
i=1
a
ij
, j = 1, . . . , n;
0 y
i
1 , i = 1, . . . , m.
(b) Use the result of Part(a) to t a straight line of the form y = ax +b to the six points data points in
the (x, y)-plane given by (2, 2), (1, 2), (1, 5), (2, 14), (3, 10), (5, 15) by minimising the sum of the
absolute errors at the six points (i.e. use L
1
curve-tting). Formulate the simplied dual LP problem
of Part (a) for this curve-tting problem and solve it using the MATLAB command linprog. (The
decision variables m and b of the primal problem are given by -lambda.eqlin use the command
in the form
[x,fval,exitflag,output,lambda] = linprog(f,[],[],Aeq,beq,lb,ub,...
[],optimset(Display,iter,LargeScale,off,Simplex,on));
For further details on using the command use help linprog in MATLAB or go to the website
http://www.mathworks.com.au/help/optim/ug/linprog.html
2
(c) Using the same data points from part (b), t another line that minimises the sum of squared errors,
m
i=1
b
i
j=1
a
ij
x
j
2
.
Use Matlabs backslash command \ with help le here
http://www.mathworks.com.au/help/matlab/ref/mldivide.html
Plot the data points and both of the straight lines you obtained in the same gure. Which point is
the outlier? Which line is less eected by the outlier, and hence a better t? Use a plot to show
what happens to the lines if you add 25 to the y-component of the outlier? Which tting method is
robust to the outlier?
3