Linear Algebra, part 3. Going back to least squares. Mathematical Models, Analysis and Simulation = 0. a T 1 e. a T n e. Anna-Karin Tornberg

Similar documents
Linear Algebra, part 3 QR and SVD

Notes on Eigenvalues, Singular Values and QR

UNIT 6: The singular value decomposition.

be a Householder matrix. Then prove the followings H = I 2 uut Hu = (I 2 uu u T u )u = u 2 uut u

Singular Value Decomposition

The Singular Value Decomposition and Least Squares Problems

Singular Value Decomposition (SVD)

Singular Value Decomposition

(a) If A is a 3 by 4 matrix, what does this tell us about its nullspace? Solution: dim N(A) 1, since rank(a) 3. Ax =

The Singular Value Decomposition

Notes on singular value decomposition for Math 54. Recall that if A is a symmetric n n matrix, then A has real eigenvalues A = P DP 1 A = P DP T.

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

LINEAR ALGEBRA 1, 2012-I PARTIAL EXAM 3 SOLUTIONS TO PRACTICE PROBLEMS

EXAM. Exam 1. Math 5316, Fall December 2, 2012

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

Linear Algebra in Actuarial Science: Slides to the lecture

Matrix decompositions

Vector and Matrix Norms. Vector and Matrix Norms

AM 205: lecture 8. Last time: Cholesky factorization, QR factorization Today: how to compute the QR factorization, the Singular Value Decomposition

Linear Algebra Primer

Notes on Solving Linear Least-Squares Problems

Computational Methods. Eigenvalues and Singular Values

SINGULAR VALUE DECOMPOSITION

COMP 558 lecture 18 Nov. 15, 2010

Linear Algebra Review. Fei-Fei Li

The Singular Value Decomposition

Linear Least Squares. Using SVD Decomposition.

Numerical Methods. Elena loli Piccolomini. Civil Engeneering. piccolom. Metodi Numerici M p. 1/??

18.06 Problem Set 10 - Solutions Due Thursday, 29 November 2007 at 4 pm in

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 9

A Review of Linear Algebra

Preliminary/Qualifying Exam in Numerical Analysis (Math 502a) Spring 2012

Review problems for MA 54, Fall 2004.

Applied Linear Algebra in Geoscience Using MATLAB

The QR Decomposition

Linear Algebra Review. Fei-Fei Li

Least Squares. Tom Lyche. October 26, Centre of Mathematics for Applications, Department of Informatics, University of Oslo

The Singular Value Decomposition (SVD) and Principal Component Analysis (PCA)

Glossary of Linear Algebra Terms. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

Lecture 6, Sci. Comp. for DPhil Students

Numerical Methods I Singular Value Decomposition

Conceptual Questions for Review

Singular Value Decompsition

AMS526: Numerical Analysis I (Numerical Linear Algebra)

I. Multiple Choice Questions (Answer any eight)

7. Symmetric Matrices and Quadratic Forms

Linear Algebra, part 2 Eigenvalues, eigenvectors and least squares solutions

Singular Value Decomposition

Maths for Signals and Systems Linear Algebra in Engineering

Math 224, Fall 2007 Exam 3 Thursday, December 6, 2007

forms Christopher Engström November 14, 2014 MAA704: Matrix factorization and canonical forms Matrix properties Matrix factorization Canonical forms

Stability of the Gram-Schmidt process

MATH 1553, Intro to Linear Algebra FINAL EXAM STUDY GUIDE

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Stat 159/259: Linear Algebra Notes

Singular value decomposition

Chapter 7: Symmetric Matrices and Quadratic Forms

MATH 612 Computational methods for equation solving and function minimization Week # 2

Fall TMA4145 Linear Methods. Exercise set Given the matrix 1 2

LinGloss. A glossary of linear algebra

Math 18, Linear Algebra, Lecture C00, Spring 2017 Review and Practice Problems for Final Exam

ANSWERS. E k E 2 E 1 A = B

Problem Set (T) If A is an m n matrix, B is an n p matrix and D is a p s matrix, then show

LINEAR ALGEBRA SUMMARY SHEET.

Lecture notes: Applied linear algebra Part 1. Version 2

MATH 20F: LINEAR ALGEBRA LECTURE B00 (T. KEMP)

MATH 304 Linear Algebra Lecture 34: Review for Test 2.

MATH36001 Generalized Inverses and the SVD 2015

linearly indepedent eigenvectors as the multiplicity of the root, but in general there may be no more than one. For further discussion, assume matrice

Singular Value Decomposition

Math 407: Linear Optimization

5 Selected Topics in Numerical Linear Algebra

Ir O D = D = ( ) Section 2.6 Example 1. (Bottom of page 119) dim(v ) = dim(l(v, W )) = dim(v ) dim(f ) = dim(v )

Linear Algebra- Final Exam Review

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

Example Linear Algebra Competency Test

Algebra C Numerical Linear Algebra Sample Exam Problems

The QR Factorization

Linear Algebra Review. Vectors

MATH 350: Introduction to Computational Mathematics

Bindel, Fall 2009 Matrix Computations (CS 6210) Week 8: Friday, Oct 17

σ 11 σ 22 σ pp 0 with p = min(n, m) The σ ii s are the singular values. Notation change σ ii A 1 σ 2

Introduction to Numerical Linear Algebra II

TBP MATH33A Review Sheet. November 24, 2018

1 Cricket chirps: an example

Pseudoinverse & Moore-Penrose Conditions

The SVD-Fundamental Theorem of Linear Algebra

Designing Information Devices and Systems II

Linear Algebra Methods for Data Mining

Linear Algebra Review

18.06SC Final Exam Solutions

Summary of Week 9 B = then A A =

This can be accomplished by left matrix multiplication as follows: I

MATH 581D FINAL EXAM Autumn December 12, 2016

Jordan Normal Form and Singular Decomposition

1. Select the unique answer (choice) for each problem. Write only the answer.

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2017 LECTURE 5

Linear Least Squares Problems

ft-uiowa-math2550 Assignment NOTRequiredJustHWformatOfQuizReviewForExam3part2 due 12/31/2014 at 07:10pm CST

MATH 235: Inner Product Spaces, Assignment 7

Transcription:

Linear Algebra, part 3 Anna-Karin Tornberg Mathematical Models, Analysis and Simulation Fall semester, 2010 Going back to least squares (Sections 1.7 and 2.3 from Strang). We know from before: The vector x that minimizes Ax b 2 is the solution to the normal equations A T Ax = A T b. This vector x =(A T A) 1 A T b is the least squares solution to Ax = b. The error e = b Ax = b p. The projection p is the closest point to b in the column space of A. The error is orthogonal to the column space of A, i.e. orthogonal to each column of A. Let A = a1 an ( each ai and e is m 1)., then A T e = a T 1 e. a T n e = 0.

Least squares solutions - how to compute them? Form the matrix K = A T A. Solve Kx = b using LU decomposition. Another idea: Obtain an orthogonal basis for A by e.g. the Gram-Schmidt orthogonalization. First: What if the columnvectors of A were orthogonal, what good would it do? [WORKSHEET] Gram-Schmidt orthogonalization Assume all columns of A are linearly independent. An orthogonal basis for A can be found by e.g. Gram-Schmidt orthogonalization. Here is the algorithm: r11 = a1, q1 = a1/r11 for k=2,3,...,n for j=2,3,...,k-1 end rjk = a T k qj =< a T k, qj > inner product qk = ak k 1 j=1 rjkqj rkk = qk qk = q k rkk end q1, q2,..., qn are now orthogonal. How does this algorithm work? [NOTES] (1)

QR factorization Given an m n matrix A, m n. - Assume that all columns ai i =1,..., n are linearly independent. (Matrix is of rank n). - Then the orthogonalization procedure produces a factorization A = QR, with Q = q1 qn, and R upper triangular and rjk and rkk as given by the Gram-Schmidt algorithm. - Q is m n, R is n n. - R is non-singular. (Upperdiagonal and diagonal entries norm of non-zero vectors). QUESTION: What do the normal equations become? FULL QR factorization Given an m n matrix A, m > n. - Matlab s QR command produces a FULL QR factorization. - It appends an additional m n orthogonal columns to Q such that it becomes an m m unitary matrix. - Rows of zeros are appended to R so that it becomes a m n matrix, still upper triangular. - The command QR(A,0) yields what they call the economy size decomposition, without this extension.

The Householder algorithm - The Householder algorithm is an alternative to Gram-Schmidt for computing the QR decomposition. - Process of orthogonal triangularization, making a matrix triangular by a sequence of unitary matrix operations. - Read in Strang! Singular Value Decomposition - Eigenvalue decomposition (A is n n): A = SΛS 1. Not all square matrices are diagonalizable. Need a full set of linearly independent eigenvectors. - Singular Value Decomposition: Am n = Um nσn nv n n. T where U and V are orthogonal matrices and Σ is a diagonal matrix with the singular values (σi) of A on the diagonal. - Singular values of A: square root of eigenvalues of A T A. - Assume that the columns of A are linearly independent, then all singular values are positive. (A T A is SPD, all eigenvalues strictly positive). QUESTION: How to solve the least squares problem, ones we know the SVD?

Singular Value Decomposition, contd. Definition: A non-negative real number σ is a singular value for A (m n) if and only if there exist unit length vectors u R m and v R n such that Av = σu and A T u = σv. The vectors u and v are called the left singular and singular vectors for A, respectively. A = UΣV T. - The column vectors of V are the orthonormal eigenvectors of A T A. - The column vectors of U are the orthonormal eigenvectors of AA T. - {v1,..., vn} forms a basis for the column space of A. - {u1,..., un} forms a basis for the row space of A. SVD, columns of A linearly dependent - A is m n, m n. Assume that the rank(a) =r < n. - A and A T A have the same null space, the same row space and the same rank. - A T A no longer positive definite, but at least definite: x T A T Ax 0 x. - All eigenvalues of A T A are non negative, λi 0. - A T A symmetric, i.e. diagonalizable. Rank of A T A and hence of A, number of strictly positive eigenvalues. - σi = λi. The rank r of A is the number of strictly positive singular values of A.

Reduced and full SVD - Number the ui, vi and σi such that σ1 σ2... σr > 0. - The orthonormal eigenvectors of A T A are in V. - AV = UΣ. Define ui = Avi/σi, i =1,..., r. - Reduced SVD: A = Um r Σr r V T r n. - To complete the v s add any orthonormal basis vr+1,..., vn for the nullspace of A. - To complete the u s add any orthonormal basis ur+1,..., um for the nullspace of A T. - Full SVD: A = Um mσm nv T n n. Pseudoinverse: A + = VΣ + U T, where Σ + has 1/σ1,..., 1/σr on its diagonal, and zeros elsewhere. Solution to least squares problem: x = A + b = VΣ + U T b. QR for rank deficient matrices - The QR algorithm can also be adapted to the case when columns of A are linearly dependent. - Gram-Schmidt algorithm combined with column reordering to choose the largest remaining column at each step. - Permutation matrix P. AP = QR. - R: Last n r rows zero, where r is rank of A. (Or for full QR: m r last rows zero).

Condition number - Condition number of matrix measures the sensitivity of the linear system Ax = b. - Perturb rhs by b. What change x does it give? What relative change x / x? - Condition number of A defined as c(a) = A A 1. - Computer algorithms for solving the linear system looses about log c decimals to round off error. If large condition number, render inaccurate solution. - A T A might have a very large condition number. Working with LU factorization (or Cholesky) on the normal equations is then not a good algorithm. - The QR-algorithm is better conditioned. Standard method for least squares problems. - If matrix close to rank-deficient, the algorithm based on the SVD is however more stable. Operation count - So far, have focused on how algorithms computes the desired solution. - Speed is important! (Think huge systems with thousands to millions of unknowns). - Operation count: Counting how many elementary operations must be done given parameters of matrix size. - Asymptotic cost for: i) Matrix vector multiply: 2nm. ii) LU decomposition: 2/3n 3. iii) Backsolve: 2n 2 iii) Total solution of linear n n system: 2/3n 3 +2n 2. - Asymptotic cost for least squares solution for m n matrix A: i) Normal equations (Cholesky): mn 2 + n 3 /3 ii) QR algorithm with Gram-Schmidt: 2mn 2. iii) SVD algorithm: 2mn 2 + 11n 3. Depends on details: Changing Gram-Schmidt to Householder, different SVD algorithm etc.

Useful property of the SVD - We can write (assuming σr+1 =... = σn = 0): A = σ1u1v 1 T + σ 1u2v 2 T + + σ r ur v r T. - Can remove the terms with small singular values and still have a good approximation of A. Low rank approximation. - If a low rank approximation of a matrix is found: takes less space to store the matrix, less time to compute a matrix vector multiply etc. - Randomized ways to find low rank approximations of matrices without actually computing the SVD, active research area (cheaper than doing the SVD). - Used also for image compression. See HW2.