pset5-s09-soln

pset5-s09-soln - 18.06 Problem Set 5 Solution Due...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 18.06 Problem Set 5 Solution Due Wednesday, 18 March 2009 at 4 pm in 2-106. Total: 130 points. Problem 1: Write down three equations for the line b = C + Dt to go through b = 7 at t =- 1, b = 7 at t = 1, and b = 21 at t = 2. Find the least-squares solution ~x = ( C,D ) T . Sketch these three points and the line you found (or use a plotting program). Solution (10 points) The equations for the line b = C + Dt is 1- 1 1 1 1 2 C D = 7 7 21 . Thus, the least-squares solution is given by solving 1 1 1- 1 1 2 1- 1 1 1 1 2 C D = 1 1 1- 1 1 2 7 7 21 , 3 2 2 6 C D = 35 42 Hence, C = 9 ,D = 4 and then ~x = (9 4) T . We plot the three points and the lines using MATLAB as follows, where the blue line is the line in the first problem and the red line is the one that passes origin in Problem 2. 2 1.5 1 0.5 0.5 1 1.5 2 2.5 3 15 10 5 5 10 15 20 25 t x 1 >> plot(-1, 7, x); plot(1, 7, x); plot(2, 21, x); >> hold on >> fplot(@(x) 4*x + 9, [-2, 3], b); >> fplot(@(x) 7*x, [-2, 3], r); >> xlabel(t); ylabel(x); >> grid Problem 2: For the same three points as in the previous problem, find the best-fit (least-squares) line through the origin . (What is the equation of a line through the origin? How many unknown parameters do you have?) Sketch this line on your plot from the previous problem. Solution (10 points) The equation for the line becomes b = Dt as the line goes through the origin. So we need to find the least-squares solution to the following linear system. - 1 1 2 ( D ) = 7 7 21 Similar to Problem 1, we need to solve (- 1 1 2 ) - 1 1 2 ( D ) = (- 1 1 2 ) 7 7 21 Hence, 6 D = 42, and we have D = 7. Problem 3: If we solve A T A ~x = A T ~ b , which of the four subspaces of A contains the error vector ~e = ~ b- A ~x ? Which contains the projection ~ p = A ~x ? Can ~x be chosen to lie completely inside any of the subspaces, and if so which one? Solution (15 points = 5+5+5) Since the error vector is orthogonal to the column space C ( A ), it lies in the left nullspace N ( A T ). The projection ~ p is on the column space C ( A ) (because it is the projection onto the column space). Since the row space C ( A T ) and the nullspace N ( A ) spans the whole space, and we can always modify the vector ~x by a vector in N ( A ) (which does not affect the projection A ~x ). Hence, we can choose ~x to be in the row space C ( A T ). 2 REMARK: We actually see this phenomenon in Problem 11(d) of Pset 4. Problem 4: In this problem, you will use 18.02-level calculus to understand why the solution to A T A~x = A T ~ b minimizes k A~x- ~ b k over all ~x , for any arbitrary m n matrix A . Consider the function: f ( ~x ) = k A~x- b k 2 = ( A~x- ~ b ) T ( A~x- ~ b ) (1) = ~x T A T A~x- ~ b T A~x- ~x T A T ~ b + ~ b T ~ b (2) = X i,j B ij x i x j- 2 X i,j A ij b i x j +...
View Full Document

This note was uploaded on 05/06/2010 for the course 18 18.06 taught by Professor Strang during the Spring '08 term at MIT.

Page1 / 14

pset5-s09-soln - 18.06 Problem Set 5 Solution Due...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online