Question: Exercise 2 General linear least squares [14 points] The attached data file general llsq data.dat contains data in the format (x, y, y) generated from

Exercise 2 General linear least squares [14 points] The attached data file general llsq data.dat contains data in the format (x, y, y) generated from f(x) = a1 + a2x + a3x 2 + a4x 3 with some parameters a1, a2, a3, a4. This data can be fitted using general linear least squares. 1 (i) Calculate the design matrix of the system. What are the dimensions of the design matrix? (ii) Use scipy to perform the singular value decomposition of the design matrix. Compute the ratio of the smallest and largest singular value. Do you have to remove any singular values in this case? (iii) Find the best fit coefficients a1, a2, a3, a4 (with errors) using the singular value decomposition. (iv) Check your result (for the values of the fit coefficients) by minimizing 2 directly. You should obtain the same coefficients. Assess the goodness of your fit. (v) Plot the data together with your fit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!