Question: Take m = 50 and n = 12. Using MATLAB's lenspiece. define t to be the m-vector of linearly spaced grid points from 0 to
Take m = 50 and n = 12. Using MATLAB's lenspiece. define t to be the m-vector of linearly spaced grid points from 0 to 1. Using MATLAB's Vander and flipper (make sure to read the documentation), define A to be the m x n matrix associated with the least squares fitting on this grid by a polynomial of degree n - 1. Take b to be the function cos(4t) evaluated on the grid. Now calculate and print to sixteen digit precision the least squares coefficient vector x by five method: Formation and solution of normal equations, using MATLAB's \. QR factorization computed by mgs. QR factorization computed by MATLAB's qr. x = A \ b in MATLAB (also bases on QR factorization). SVD, using HATLAB's svd. The calculations above will produce five lists of twelve coefficients. In each list. shade with red pen the digits that appear to be wrong (affected by rounding error), Comment on differences you observe. Do the normal equation exhibit instability? You do not have to explain your observations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
