Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started