Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Announcements: The deadline for grad lecture notes was extended to Friday Nov. 9 at 3:30pm. Assignment #4 is posted: Due Thurs. Nov. 15. Nov. 12-14 is.

Similar presentations


Presentation on theme: "1 Announcements: The deadline for grad lecture notes was extended to Friday Nov. 9 at 3:30pm. Assignment #4 is posted: Due Thurs. Nov. 15. Nov. 12-14 is."— Presentation transcript:

1 1 Announcements: The deadline for grad lecture notes was extended to Friday Nov. 9 at 3:30pm. Assignment #4 is posted: Due Thurs. Nov. 15. Nov. 12-14 is reading break. I plan on holding a Test #2 tutorial on Thurs. Nov. 15 during class. Test #2 is on Mon. Nov. 19, in class. Mandatory attendance starts Wed. Nov. 21. A handout for the integer programming material was given out in class.

2 2

3 xyL 1 -fit 11174 218 32930 442402 3

4 4

5 How do we formulate the fitting problem as a linear program for each of these norms? In both cases we want to find a 0 and a 1 so that the linear approximation is: y= a 0 + a 1 x = a 0 1 + a 1 x xy 111 218 329 442 5

6 L 1 -norm: minimize the sum of the absolute values of the differences. Minimize |d 1 |+ |d 2 |+ |d 3 |+ | d 4 | subject to d 1 = 11 – (a 0 1+ a 1 1) d 2 = 18 – (a 0 1+ a 1 2) d 3 = 29 – (a 0 1+ a 1 3) d 4 = 42 – (a 0 1+ a 1 4) This is not in standard form. xy 111 218 329 442 6

7 To manage the absolute values: Minimize |d 1 |+ |d 2 |+ |d 3 |+ | d 4 |= u 1 + v 1 + u 2 + v 2 + u 3 + v 3 + u 4 + v 4 subject to d 1 = u 1 – v 1 = 11 – (a 0 1+ a 1 1) d 2 = u 2 – v 2 = 18 – (a 0 1+ a 1 2) d 3 = u 3 – v 3 = 29 – (a 0 1+ a 1 3) d 4 = u 4 – v 4 = 42 – (a 0 1+ a 1 4) u 1, u 2, u 3, u 4 ≥ 0 v 1, v 2, v 3, v 4 ≥ 0 The value of u i is > 0 if d i is strictly positive. The value of v i is > 0 if d i is strictly negative. 7

8 Change to Maximize: Minimize u 1 + v 1 + u 2 + v 2 + u 3 + v 3 + u 4 + v 4 becomes Maximize -u 1 - v 1 - u 2 - v 2 - u 3 - v 3 - u 4 - v 4 8

9 Missing non-negativity constraints on the a 0 and a 1 : u 1 – v 1 = 11 – (a 0 1+ a 1 1) u 2 – v 2 = 18 – (a 0 1+ a 1 2) u 3 – v 3 = 29 – (a 0 1+ a 1 3) u 4 – v 4 = 42 – (a 0 1+ a 1 4) Set a 0 = b 0 -c 0 Set a 1 = b 1 -c 1 b 0, b 1, c 0, c 1 ≥ 0 9

10 Maximize 0 b 0 + 0 c 0 + 0 b 1 + 0 c 1 -u 1 - v 1 - u 2 - v 2 - u 3 - v 3 - u 4 - v 4 subject to u 1 – v 1 = 11 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 1) u 2 – v 2 = 18 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 2) u 3 – v 3 = 29 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 3) u 4 – v 4 = 42 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 4) Finally, change each equality constraint: u 1 – v 1 ≤ 11 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 1) u 1 – v 1 ≥ 11 – ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 1) ⟹ -u 1 + v 1 ≤ - 11 + ( (b 0 – c 0 ) 1+ (b 1 – c 1 ) 1) 10

11 The L 1 -norm: The result from running my program. The optimal solution: -6.0 [So the error is 6] X1= b 0 = 0 X2 = c 0 = 4 X3= b 1 = 11 X4 = c 1 = 0 a 0 = b 0 -c 0 = -4 a 1 = b 1 -c 1 = 11 So the curve is y = -4 + 11 x 11

12 12

13 13

14 xyL 1 -fit 11174 218 32930 442402 14

15 15


Download ppt "1 Announcements: The deadline for grad lecture notes was extended to Friday Nov. 9 at 3:30pm. Assignment #4 is posted: Due Thurs. Nov. 15. Nov. 12-14 is."

Similar presentations


Ads by Google