Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4. Take m = 50, n = 12. Using MATLAB's linspace, define t to be the m-vector corre- sponding to linearly spaced grid points

image text in transcribed
Problem 4. Take m = 50, n = 12. Using MATLAB's linspace, define t to be the m-vector corre- sponding to linearly spaced grid points from 0 to 1. Using MATLAB's vander and fliplr, define A to be the m x n matrix associated with least squares fitting on this grid by a polynomial of order n - 1. Take b to be the function cos(4t) evaluated on the grid. Now, calculate and print (to 16 digit precision) the least squares coefficient vector x by the following three methods. (a) Solving the normal equation explicitly computing (AT A)-1. (b) Using the MATLAB implementation of the classical Gram-Schmidt algorithm cgs. (c) QR factorization using MATLAB's qr, which is based on the Householder triangularization. (d) x = A \\ b in MATLAB, which is also based on QR factorization. (e) The calculations above will produce five lists of twelve coefficients. In each list, shade with red pen (or highlighter/marker) the digits appear to be wrong (affected by rounding error). Comment on what differences you observe. Do the normal equations exhibit instability? You do not have to explain your observations

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Probability

Authors: Mark Daniel Ward, Ellen Gundlach

1st edition

716771098, 978-1319060893, 1319060897, 978-0716771098

More Books

Students also viewed these Mathematics questions

Question

\f

Answered: 1 week ago