CS 531/ECE 517 Computer HW 2
Due Mar 20
Consider the following 2D data points:
1.0 0.5
1.1 1.5
1.5 2.1
2.5 1.4
2.7 2.3
3.8 2.1
3.7 5.1
5.1 3.2
5.2 6.9
6.3 3.9
8.0 8.0
8.2 6.9
9.0 7.9
9.2 6.9
10.1 10.0
10.6 8.8
11.2 9.5
11.8 10.9
12.1 10.0
12.9 9.7
13.2 11.9
14.1 10.8
14.2 10.0
14.2 15.0
15.1 11.8
1) Perform linear regression to estimate the trend as a line.
1.a) Plot the points.
1.b) Setup the "design matrix".
1.c) Solve for weights.
1.d) Plot the line.
2) Perform linear regression to estimate the trend as a 6th degree polynomial.
      y(x) = w0 + w1x + w2x2
+ w3x3 + w4x4 + w5x5 + w6x6
2.a) Setup the design matrix.
2.b) Solve for weights.
2.c) Plot the polynomial.
2.d) Compare the result of problem 2 and problem 1. Which do you think better represents the data? Why?
3) Use least squares to identify linear discriminants for the table of data in section 5 computer exercises.
      Compute the linear discrimiants for classes 1,2,3 (ignore 4).
3.a) Compute 3 linear discrimiants for class i and "not class i". Use the same number of samples for class i and "not class i".
3.b) Compute 3 linear discriminats for class i and "not class i". Use all samples available for "not class i".
3.c) What is the classification error for 3.a and 3.b? (totall number of missclassified samples)
3.d) Explain the difference in these two approaches.