Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab project. Please help with clear code. Thank you. Least squares solution and round-off errors (25 points) 1 1 -10-k Let k be any positive

Matlab project. Please help with clear code. Thank you.

image text in transcribed

Least squares solution and round-off errors (25 points) 1 1 -10-k Let k be any positive integer, and A 10- 0 b= 1+ 10-k 0 10-k 1 - 10-4 Write a MATLAB code YourlastnameyourfirstnameHW6p2.m that for each k = 5,6,7,8, com- putes the least squares solution for the above A, b, in three different ways: (i) analytically solve the normal equation by hand and hard code that analytical solution xhat_analytical, (ii) xhat QR that numerically solves the normal equation using QR decomposition, (iii) xhat normal that numerically solves the normal equation as a square linear system. In other words, your code should output 3 different least squares solutions for each k, where the integer k increments in a for loop from 5 to 8. For computing the analytical solution in part (i), you may use the formula for the inverse of a 2 x 2 matrix: -1 d (20) 1 ad - bc -C a Least squares solution and round-off errors (25 points) 1 1 -10-k Let k be any positive integer, and A 10- 0 b= 1+ 10-k 0 10-k 1 - 10-4 Write a MATLAB code YourlastnameyourfirstnameHW6p2.m that for each k = 5,6,7,8, com- putes the least squares solution for the above A, b, in three different ways: (i) analytically solve the normal equation by hand and hard code that analytical solution xhat_analytical, (ii) xhat QR that numerically solves the normal equation using QR decomposition, (iii) xhat normal that numerically solves the normal equation as a square linear system. In other words, your code should output 3 different least squares solutions for each k, where the integer k increments in a for loop from 5 to 8. For computing the analytical solution in part (i), you may use the formula for the inverse of a 2 x 2 matrix: -1 d (20) 1 ad - bc -C a

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago