MATH 3795 Lecture 10. Regularized Linear Least Squares.

Similar documents
MARN 5898 Regularized Linear Least Squares.

Linear Least Squares. Using SVD 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.

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

MATH 3511 Lecture 1. Solving Linear Systems 1

Outline. Math Numerical Analysis. Errors. Lecture Notes Linear Algebra: Part B. Joseph M. Mahaffy,

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

UNIT 6: The singular value decomposition.

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

Linear Algebra - Part II

Computational Methods. Eigenvalues and Singular Values

Numerical Methods I Singular Value Decomposition

COMP 558 lecture 18 Nov. 15, 2010

Lecture 9. Errors in solving Linear Systems. J. Chaudhry (Zeb) Department of Mathematics and Statistics University of New Mexico

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

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Singular value decomposition

Background Mathematics (2/2) 1. David Barber

Linear Algebra in Actuarial Science: Slides to the lecture

14 Singular Value Decomposition

1 Linearity and Linear Systems

CS 143 Linear Algebra Review

Linear Algebra Review. Vectors

(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 =

Singular Value Decomposition

The Singular Value Decomposition

MIT Final Exam Solutions, Spring 2017

Lecture 6. Numerical methods. Approximation of functions

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Applied Numerical Linear Algebra. Lecture 8

GI07/COMPM012: Mathematical Programming and Research Methods (Part 2) 2. Least Squares and Principal Components Analysis. Massimiliano Pontil

ANSWERS. E k E 2 E 1 A = B

33AH, WINTER 2018: STUDY GUIDE FOR FINAL EXAM

3D Computer Vision - WT 2004

CS 322 Homework 8 Solutions

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

Linear Algebra Primer

Linear Algebra Review. Fei-Fei Li

2. Review of Linear Algebra

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

Problem # Max points possible Actual score Total 120

A MODIFIED TSVD METHOD FOR DISCRETE ILL-POSED PROBLEMS

Notes on Eigenvalues, Singular Values and QR

Econ Slides from Lecture 7

DS-GA 1002 Lecture notes 10 November 23, Linear models

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Review problems for MA 54, Fall 2004.

Linear Algebra, part 3 QR and SVD

Computational Methods CMSC/AMSC/MAPL 460. EigenValue decomposition Singular Value Decomposition. Ramani Duraiswami, Dept. of Computer Science

Lecture 7. Gaussian Elimination with Pivoting. David Semeraro. University of Illinois at Urbana-Champaign. February 11, 2014

Linear Least-Squares Data Fitting

Math 489AB Exercises for Chapter 2 Fall Section 2.3

Eigenvalues and diagonalization

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

CS6964: Notes On Linear Systems

Computational math: Assignment 1

Maths for Signals and Systems Linear Algebra in Engineering

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2013 PROBLEM SET 2

Linear Algebra and Matrices

Preliminary Examination, Numerical Analysis, August 2016

Chapters 5 & 6: Theory Review: Solutions Math 308 F Spring 2015

Tikhonov Regularization in Image Reconstruction with Kaczmarz Extended Algorithm

Lecture: Face Recognition and Feature Reduction

Final Review Written by Victoria Kala SH 6432u Office Hours R 12:30 1:30pm Last Updated 11/30/2015

Let A an n n real nonsymmetric matrix. The eigenvalue problem: λ 1 = 1 with eigenvector u 1 = ( ) λ 2 = 2 with eigenvector u 2 = ( 1

Linear Algebra Review. Fei-Fei Li

15 Singular Value Decomposition

Lecture 8: Linear Algebra Background

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for At a high level, there are two pieces to solving a least squares problem:

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2017 LECTURE 5

MATH 350: Introduction to Computational Mathematics

CS 246 Review of Linear Algebra 01/17/19

Lecture 3: Review of Linear Algebra

MATH 122: Matrixology (Linear Algebra) Solutions to Level Tetris (1984), 10 of 10 University of Vermont, Fall 2016

Lecture 3: Review of Linear Algebra

3 (Maths) Linear Algebra

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

REGULARIZATION PARAMETER SELECTION IN DISCRETE ILL POSED PROBLEMS THE USE OF THE U CURVE

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Singular Value Decomposition

Linear Systems. Carlo Tomasi. June 12, r = rank(a) b range(a) n r solutions

Scientific Computing: Dense Linear Systems

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

Singular Value Decomposition: Compression of Color Images

Linear Algebra: Matrix Eigenvalue Problems

Linear Systems. Carlo Tomasi

The Full-rank Linear Least Squares Problem

Applied Mathematics 205. Unit V: Eigenvalue Problems. Lecturer: Dr. David Knezevic

Ridge Regression. Flachs, Munkholt og Skotte. May 4, 2009

Eigenvectors and SVD 1

Linear Algebra & Geometry why is linear algebra useful in computer vision?

JUST THE MATHS SLIDES NUMBER 9.6. MATRICES 6 (Eigenvalues and eigenvectors) A.J.Hobson

The Singular Value Decomposition

Lecture 4.3 Estimating homographies from feature correspondences. Thomas Opsahl

Problems. Looks for literal term matches. Problems:

Eigenvalues and Singular Values

Discrete Ill Posed and Rank Deficient Problems. Alistair Boyle, Feb 2009, SYS5906: Directed Studies Inverse Problems 1

Lecture 9: Numerical Linear Algebra Primer (February 11st)

B553 Lecture 5: Matrix Algebra Review

Transcription:

MATH 3795 Lecture 10. Regularized Linear Least Squares. Dmitriy Leykekhman Fall 2008 Goals Understanding the regularization. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 1

Review. Consider the linear least square problem From the last lecture: min Ax x R b 2 2. n Let A = UΣV T be the Singular Value Decomposition of A R m n with singular values σ 1 σ r > σ r+1 = = σ min {m,n} = 0 The minimum norm solution is x = r i=1 u T i b v i σ i If even one singular value σ i is small, then small perturbations in b can lead to large errors in the solution. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 2

Regularized Linear Least Squares Problems. If σ 1 /σ r 1, then it might be useful to consider the regularized linear least squares problem (Tikhonov regularization) 1 min x R n 2 Ax b 2 2 + λ 2 x 2 2. Here λ > 0 is the regularization parameter. The regularization parameter λ > 0 is not known a-priori and has to be determined based on the problem data. See later. Observe that 1 min x 2 Ax b 2 2 + λ ( 2 x 2 2 = min x ) ( λi A b x 0 ) 2. 2 D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 3

Regularized Linear Least Squares Problems. Thus 1 min x 2 Ax b 2 2 + λ ( ) ( ) 2 x 2 2 = min λi A b 2 x x. (1) 0 2 For λ > 0 the matrix ( A λi ) R (m+n) n has always full rank n. Hence, for λ > 0, the regularized linear least squares problem (1) has a unique solution. The normal equation corresponding to (1) are given by ( A λi ) T ( ) ( ) T ( λi A A x = (A T A+λI)x = A T b = λi b 0 ) T. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 4

Regularized Linear Least Squares Problems. SVD Decomposition: A = UΣV T, where U R m m and V R n n are orthogonal matrices and Σ R m n is a diagonal matrix with diagonal entries Thus the normal to (1) can be written as σ 1 σ r > σ r+1 = = σ min {m,n} = 0. (A T A + λi)x λ = A T b, (V Σ T U }{{ T U } ΣV T + λ }{{} I )x λ = V Σ T U T b. =I =V V T D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 5

Regularized Linear Least Squares Problems. SVD Decomposition: A = UΣV T, where U R m m and V R n n are orthogonal matrices and Σ R m n is a diagonal matrix with diagonal entries Thus the normal to (1) can be written as σ 1 σ r > σ r+1 = = σ min {m,n} = 0. (A T A + λi)x λ = A T b, (V Σ T U }{{ T U } ΣV T + λ }{{} I )x λ = V Σ T U T b. =I =V V T Rearranging terms we obtain V (Σ T Σ + λi)v T x λ = V Σ T U T b, multiplying both sides by V T from the left and setting z = V T x λ we get (Σ T Σ + λi)z = Σ T U T b. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 5

Regularized Linear Least Squares Problems. The normal equation corresponding to (1), is equivalent to where z = V T x λ. Solution z i = (A T A + λi)x λ = A T b, (Σ T Σ + λi) z = Σ T U T b. }{{} diagonal { σi(u T i b), i = 1,..., r, σi 2 +λ 0, i = r + 1,..., n. Since x λ = V z = n i=1 z iv i, the solution of the regularized linear least squares problem (1) is given by x λ = r i=1 σ i (u T i b) σ 2 i + λ v i. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 6

Regularized Linear Least Squares Problems. Note that lim x λ = lim λ 0 λ 0 r i=1 σ i (u T i b) σ 2 i + λ v i = r i=1 u T i b σ i v i = x i.e., the solution of the regularized LLS problem (1) converges to the minimum norm solution of the LLS problem as λ goes to zero. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 7

Regularized Linear Least Squares Problems. Note that lim x λ = lim λ 0 λ 0 r i=1 σ i (u T i b) σ 2 i + λ v i = r i=1 u T i b σ i v i = x i.e., the solution of the regularized LLS problem (1) converges to the minimum norm solution of the LLS problem as λ goes to zero. The representation x λ = r i=1 σ i (u T i b) σ 2 i + λ v i of the solution of the regularized LLS also reveals the regularizing property of adding the term λ 2 x 2 2 to the (ordinary) least squares functional. We have that σ i (u T i b) σ 2 i + λ { 0, if 0 σi λ u T i b σ i, if σ i λ. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 7

Regularized Linear Least Squares Problems. Hence, adding λ 2 x 2 2 to the (ordinary) least squares functional acts as a filter. Contributions from singular values which are large relative to the regularization parameter λ are left (almost) unchanged whereas contributions from small singular values are (almost) eliminated. It raises an important question: How to choose λ? D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 8

Regularized Linear Least Squares Problems. Suppose that the data are b = b ex + δb. We want to compute the minimum norm solution of the (ordinary) LLS with unperturbed data b ex r u T i xex = b v i σ i but we can only compute with b = b ex + δb, we don t know b ex. i=1 The solution of the regularized least squares problem is x λ = r ( σi (u T i b ex) i=1 σ 2 i + λ + σ i(u T i δb) ) σi 2 + λ v i. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 9

Regularized Linear Least Squares Problems. We observed that r i=1 On the other hand σ i (u T i δb) σ 2 i + λ σ i (u T i b ex) σ 2 i + λ x ex as λ 0. { 0, if 0 σi λ u T i δb σ i, if σ i λ, which suggests to choose λ sufficiently large to ensure that errors δb in the data are not magnified by small singular values. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 10

for i = 0:7 % solve regularized LLS for different lambda lambda(i+1) = 10^(-i) xlambda = V * (sigma.*(u *b)./ (sigma.^2 + lambda(i+1))) err(i+1) = norm(xlambda - xex); end D. Leykekhman loglog(lambda,err, * ); - MATH 3795 Introduction to Computational Mathematics ylabel( x^{ex} Linear Least Squares - 11 x_{\lambda} _2 ); xl Regularized Linear Least Squares Problems. % Compute A t = 10.^(0:-1:-10) ; A = [ ones(size(t)) t t.^2 t.^3 t.^4 t.^5]; % compute exact data xex = ones(6,1); bex = A*xex; % data perturbation of 0.1% deltab = 0.001*(0.5-rand(size(bex))).*bex; b = bex+deltab; % compute SVD of A [U,S,V] = svd(a); sigma = diag(s);

Regularized Linear Least Squares Problem. The error x ex x λ 2 for different values of λ (loglog-scale): D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 12

Regularized Linear Least Squares Problem. The error x ex x λ 2 for different values of λ (loglog-scale): For this example λ 10 3 is a good choice for the regularization parameter λ. However, we could only create this figure with the knowledge of the desired solution x ex. How can we determine a λ 0 so that x ex x λ 2 is small without knowledge of x ex. One approach is the Morozov discrepancy principle. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 12

Regularized Linear Least Squares Problem. Suppose b = b ex + δb. We do not know the perturbation δb, but we assume that we know its size δb. Suppose the unknown desired solution x ex satisfies Ax ex = b ex. Hence, Ax ex b = Ax ex b ex δb = δb. Since the exact solution satisfies Ax ex b = δb we want to find a regularization parameter λ 0 such that the solution x λ of the regularized least squares problem satisfies Ax λ b = δb This is Morozov s discrepancy principle. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 13

Regularized Linear Least Squares Problem. Let s see now this works for the previous Matlab example. The error x ex x λ 2 for different values of λ (log-log-scale) The residual Ax λ b 2 and δb 2 for different values of λ (log-log- scale) D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 14

Regularized Linear Least Squares Problem. Morozov s discrepancy principle: Find λ 0 such that Ax λ b = δb D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 15

Regularized Linear Least Squares Problem. Morozov s discrepancy principle: Find λ 0 such that Ax λ b = δb To compute Ax λ b for given λ 0 we need to solve a regularized linear least squares problem 1 min x 2 Ax b 2 2 + λ ( ) ( 2 x 2 2 = min λi A b x x 0 ) 2 2 to get x λ and then we have to compute Ax λ b. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 15

Regularized Linear Least Squares Problem. Morozov s discrepancy principle: Find λ 0 such that Ax λ b = δb To compute Ax λ b for given λ 0 we need to solve a regularized linear least squares problem 1 min x 2 Ax b 2 2 + λ ( ) ( 2 x 2 2 = min λi A b x x 0 ) 2 2 to get x λ and then we have to compute Ax λ b. Let f(λ) = Ax λ b δb. Finding λ 0 such that f(λ) = 0 is a root finding problem. We will discuss in the future how to solve such problems. In this case f maps a scalar λ into a scalar f(λ) = Ax λ b δb, but the evaluation of f requires the solution of a regularized LLS problems and can be rather expensive. D. Leykekhman - MATH 3795 Introduction to Computational Mathematics Linear Least Squares 15