on bases and least square method
play

ON-Bases and Least Square Method Artem Los (arteml@kth.se) - PowerPoint PPT Presentation

ON-Bases and Least Square Method Artem Los (arteml@kth.se) February 21th, 2017 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 1 / 17 Overview Projections onto Subspaces 1 Orthogonal Complement 2


  1. ON-Bases and Least Square Method Artem Los (arteml@kth.se) February 21th, 2017 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 1 / 17

  2. Overview Projections onto Subspaces 1 Orthogonal Complement 2 Gram-Schmidt Method 3 Least Square Regression 4 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 2 / 17

  3. Projections onto Subspaces Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 3 / 17

  4. Projecting a vector onto subspace Projection of vector � b onto a plane π is the best approximation of b in π , defined as: � � b · � v 1 b · � v 2 proj π = v 1 || 2 � v 1 + v 2 || 2 � v 2 || � || � Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 4 / 17

  5. Projecting a vector onto subspace Projection of vector � b onto a plane π is the best approximation of b in π , defined as: � � b · � v 1 b · � v 2 proj π = v 1 || 2 � v 1 + v 2 || 2 � v 2 || � || � We’ve assumed that π = span { � v 1 , � v 2 } . The same pattern is applied to hyper planes, etc. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 4 / 17

  6. Example Problem. Find the projection of � x = (2 , 3 , 5 , 6) onto π = s (1 , − 1 , − 1 , 1) + t (1 , 2 , 1 , 2) : s , t ∈ R Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 5 / 17

  7. Example Problem. Find the projection of � x = (2 , 3 , 5 , 6) onto π = s (1 , − 1 , − 1 , 1) + t (1 , 2 , 1 , 2) : s , t ∈ R Step 1: Find proj π ( � x ) using the definition � � b · � b · � v 1 v 2 proj π = v 1 || 2 � v 1 + v 2 || 2 � v 2 = || � || � Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 5 / 17

  8. Example Problem. Find the projection of � x = (2 , 3 , 5 , 6) onto π = s (1 , − 1 , − 1 , 1) + t (1 , 2 , 1 , 2) : s , t ∈ R Step 1: Find proj π ( � x ) using the definition � � b · � b · � v 1 v 2 proj π = v 1 || 2 � v 1 + v 2 || 2 � v 2 = || � || � x = (2 , 3 , 5 , 6) · (1 , − 1 , − 1 , 1) proj π � (1 , − 1 , − 1 , 1)+ || (1 , − 1 , − 1 , 1) || 2 +(2 , 3 , 5 , 6) · (1 , 2 , 1 , 2) (1 , 2 , 1 , 2) = || (1 , 2 , 1 , 2) || 2 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 5 / 17

  9. Example Problem. Find the projection of � x = (2 , 3 , 5 , 6) onto π = s (1 , − 1 , − 1 , 1) + t (1 , 2 , 1 , 2) : s , t ∈ R Step 1: Find proj π ( � x ) using the definition � � b · � b · � v 1 v 2 proj π = v 1 || 2 � v 1 + v 2 || 2 � v 2 = || � || � x = (2 , 3 , 5 , 6) · (1 , − 1 , − 1 , 1) proj π � (1 , − 1 , − 1 , 1)+ || (1 , − 1 , − 1 , 1) || 2 +(2 , 3 , 5 , 6) · (1 , 2 , 1 , 2) (1 , 2 , 1 , 2) = || (1 , 2 , 1 , 2) || 2 � 5 2 , 5 , 5 � = 2 , 5 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 5 / 17

  10. Orthogonal Complement Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 6 / 17

  11. Orthogonal complement Relationship with row space For all matrices A , the null space of A is an orthogonal complement to the row space of A . Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 7 / 17

  12. Orthogonal complement Relationship with row space For all matrices A , the null space of A is an orthogonal complement to the row space of A . How about A T ? Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 7 / 17

  13. Example Find the basis of the orthogonal complement of Problem. S = span { (1 , 2 , − 1) } , i.e. S ⊥ . Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 8 / 17

  14. Example Find the basis of the orthogonal complement of Problem. S = span { (1 , 2 , − 1) } , i.e. S ⊥ . Step 1: Transform into a plane. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 8 / 17

  15. Example Find the basis of the orthogonal complement of Problem. S = span { (1 , 2 , − 1) } , i.e. S ⊥ . Step 1: Transform into a plane. S = span { (1 , 2 , − 1) } means the equation of the plane is x 1 + 2 x 2 − x 3 . Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 8 / 17

  16. Example Find the basis of the orthogonal complement of Problem. S = span { (1 , 2 , − 1) } , i.e. S ⊥ . Step 1: Transform into a plane. S = span { (1 , 2 , − 1) } means the equation of the plane is x 1 + 2 x 2 − x 3 . Step 2: Insert this into a matrix (interpret as row space) Since we want to find the null space, we solve x 1 + 2 x 2 − x 3 = 0. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 8 / 17

  17. Example Find the basis of the orthogonal complement of Problem. S = span { (1 , 2 , − 1) } , i.e. S ⊥ . Step 1: Transform into a plane. S = span { (1 , 2 , − 1) } means the equation of the plane is x 1 + 2 x 2 − x 3 . Step 2: Insert this into a matrix (interpret as row space) Since we want to find the null space, we solve x 1 + 2 x 2 − x 3 = 0. Step 3: Use parametrisation to get the solution space (here it’s null space) s ( − 2 , 1 , 0) + t (1 , 0 , 1) s , t ∈ R Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 8 / 17

  18. Gram-Schmidt Method Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 9 / 17

  19. Find orthonormal basis using Gram-Schmidt Method Goal. We want to find an orthonormal basis given { � v 1 , � v 2 , . . . , � v k } . We will see later that this is useful. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 10 / 17

  20. Find orthonormal basis using Gram-Schmidt Method Goal. We want to find an orthonormal basis given { � v 1 , � v 2 , . . . , � v k } . We will see later that this is useful. Algorithm. Step1 : � u 1 = � v 1 v 2 − � v 2 · � u 1 Step2 : � u 2 = � u 1 || 2 � u 1 || � v 3 − � v 3 · � u 1 − � v 3 · � u 1 u 2 Step2 : � u 3 = � u 1 || 2 � u 2 || 2 � u 2 || � || � . . . r times Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 10 / 17

  21. Example Problem. We are given a basis spanned by (1 , 1 , 1) , (1 , 1 , 0) , (1 , 0 , 0). Find an orthonormal basis. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 11 / 17

  22. Example Problem. We are given a basis spanned by (1 , 1 , 1) , (1 , 1 , 0) , (1 , 0 , 0). Find an orthonormal basis. Step 1: Find an orthogonal basis using Gram-Schmidt process. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 11 / 17

  23. Example Problem. We are given a basis spanned by (1 , 1 , 1) , (1 , 1 , 0) , (1 , 0 , 0). Find an orthonormal basis. Step 1: Find an orthogonal basis using Gram-Schmidt process. Step 2: Normalize the new vectors to get an orthonormal basis. Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 11 / 17

  24. Example Problem. We are given a basis spanned by (1 , 1 , 1) , (1 , 1 , 0) , (1 , 0 , 0). Find an orthonormal basis. Step 1: Find an orthogonal basis using Gram-Schmidt process. Step 2: Normalize the new vectors to get an orthonormal basis. Example in Python Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 11 / 17

  25. Least Square Regression Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 12 / 17

  26. Definition Least Square Method The method of least squares is a standard approach in regression analysis to the approximate solution of overdetermined systems, i.e., sets of equations in which there are more equations than unknowns . (From https://en.wikipedia.org/wiki/Least_squares ) Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 13 / 17

  27. Definition Least Square Method The method of least squares is a standard approach in regression analysis to the approximate solution of overdetermined systems, i.e., sets of equations in which there are more equations than unknowns . (From https://en.wikipedia.org/wiki/Least_squares ) Examples of usage: Find the equation of straight line going through a set of points (eg. from an experiment). Fitting a curve to set of points Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 13 / 17

  28. The trick of solving overdetermined systems Let A be the matrix with more equations than unknowns (i.e. x − � overdetermined). Then, to minimize || A � b || is the same as solving x = A T � A T A � b . So, x = A T � x = ( A T A ) − 1 A T � A T A � b = ⇒ � b Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 14 / 17

  29. Example We want to fit y = a + bt 2 and we are given five data points: Problem. ( − 2 , 1) , ( − 1 , 1) , (0 , 2) , (1 , 3) , (2 , − 2) Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 15 / 17

  30. Example We want to fit y = a + bt 2 and we are given five data points: Problem. ( − 2 , 1) , ( − 1 , 1) , (0 , 2) , (1 , 3) , (2 , − 2) Step 1: Find A  1 4  1 1     1 0     1 1   1 4 Artem Los (arteml@kth.se) ON-Bases and Least Square Method February 21th, 2017 15 / 17

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend