Question: 1. Consider some masurement data is given below. x_data = [-2.26 -2.01 -1.41 -0.62 0 0.52 1.07 1.21 1.86 2.63 2.88]; y_data = [-2.00
1. Consider some masurement data is given below. x_data = [-2.26 -2.01 -1.41 -0.62 0 0.52 1.07 1.21 1.86 2.63 2.88]; y_data = [-2.00 -3.91 -2.62 -3.15 0 1.56 2.42 1.97 1.37 1.86 1.00]; i) Find linear function in form of f(x) = ax + b which minimizes square error If (xdata) - Ydatal2 and calculate this error (Write analytical expression explicitly.). (10p) ii) Find second order polynomial function in form of f(x) = a + ax + ax which minimizes square error ||f(xdata) Ydatall, and calculate this error (Write analytical expression explicitly.). (10p) iii) Consider part i). Pick up 100 value between -5 and 5 for both a and b. Calculate |lf (xdata) - Ydata|| for each (a, b) pair by computer code. Check that whether there is a value lower than the error found in i). Comment the result. (5p) iv) Plot the measurement data and the function found in i) in a same figure. (Consider "scatter, plot, hold on" commands for MATLAB). (5p) v) Plot the measurement data and the function found in ii) in a same figure. (Consider "scatter, plot, hold on" commands for MATLAB). (5p) vi) Let [A1]11x2[b, a]2x1 = [b]11x1 the matrix equation constructed by the data and given model in i). Show that (ATA)-ATb gives same result found in i). (Use computer code) (5p) vii) Let [A1]11x3[ao, a1, a2l3x1 = [b]11x1 the matrix constructed by the data and given model in ii). Show that (ATA)-1ATb gives same result found in ii). (Use computer code) (5p)
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
i To find the linear function in the form of fx ax b that minimizes the square error we need to minimize the squared difference between the predicted values fxdata and the actual values Ydata Lets den... View full answer
Get step-by-step solutions from verified subject matter experts
