Review of Linear Algebra

Similar documents
Linear Algebra Review. Vectors

Linear Algebra (Review) Volker Tresp 2018

Knowledge Discovery and Data Mining 1 (VO) ( )

Linear Algebra (Review) Volker Tresp 2017

Review of Linear Algebra

Lecture 3: Matrix and Matrix Operations

Properties of Matrices and Operations on Matrices

Quantum Computing Lecture 2. Review of Linear Algebra

Phys 201. Matrices and Determinants

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

CS 246 Review of Linear Algebra 01/17/19

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

CS 143 Linear Algebra Review

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Linear Algebra V = T = ( 4 3 ).

Large Scale Data Analysis Using Deep Learning

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Chapter 2. Linear Algebra. rather simple and learning them will eventually allow us to explain the strange results of

Foundations of Computer Vision

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

Deep Learning Book Notes Chapter 2: Linear Algebra

Introduction to Matrix Algebra

ICS 6N Computational Linear Algebra Matrix Algebra

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Mathematical foundations - linear algebra

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Linear Algebra for Machine Learning. Sargur N. Srihari

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

Singular Value Decomposition and Principal Component Analysis (PCA) I

Lecture II: Linear Algebra Revisited

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Lecture 1 Review: Linear models have the form (in matrix notation) Y = Xβ + ε,

Lecture Notes in Linear Algebra

Image Registration Lecture 2: Vectors and Matrices

Matrices BUSINESS MATHEMATICS

Lecture 15 Review of Matrix Theory III. Dr. Radhakant Padhi Asst. Professor Dept. of Aerospace Engineering Indian Institute of Science - Bangalore

Matrix & Linear Algebra

Elementary Row Operations on Matrices

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Matrices and Vectors. Definition of Matrix. An MxN matrix A is a two-dimensional array of numbers A =

. a m1 a mn. a 1 a 2 a = a n

Review of linear algebra

1. What is the determinant of the following matrix? a 1 a 2 4a 3 2a 2 b 1 b 2 4b 3 2b c 1. = 4, then det

Section 9.2: Matrices.. a m1 a m2 a mn

Mathematical foundations - linear algebra

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Linear Algebra. Session 12

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

2. Linear algebra. matrices and vectors. linear equations. range and nullspace of matrices. function of vectors, gradient and Hessian

Applied Linear Algebra in Geoscience Using MATLAB

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

The Singular Value Decomposition

Lecture notes on Quantum Computing. Chapter 1 Mathematical Background

j=1 u 1jv 1j. 1/ 2 Lemma 1. An orthogonal set of vectors must be linearly independent.

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

Matrix Representation

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

Introduction to Quantitative Techniques for MSc Programmes SCHOOL OF ECONOMICS, MATHEMATICS AND STATISTICS MALET STREET LONDON WC1E 7HX

Matrix Arithmetic. j=1

NOTES on LINEAR ALGEBRA 1

Bare minimum on matrix algebra. Psychology 588: Covariance structure and factor models

Fundamentals of Engineering Analysis (650163)

Elementary maths for GMT

Introduction to Matrices

Vectors To begin, let us describe an element of the state space as a point with numerical coordinates, that is x 1. x 2. x =

Linear Algebra March 16, 2019

Getting Started with Communications Engineering. Rows first, columns second. Remember that. R then C. 1

Linear Algebraic Equations

POLI270 - Linear Algebra

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

b 1 b 2.. b = b m A = [a 1,a 2,...,a n ] where a 1,j a 2,j a j = a m,j Let A R m n and x 1 x 2 x = x n

Cheng Soon Ong & Christian Walder. Canberra February June 2017

Matrices and Linear Algebra

Quick Tour of Linear Algebra and Graph Theory

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

MAT 2037 LINEAR ALGEBRA I web:

Matrix Algebra: Summary

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

Linear Algebra in Computer Vision. Lecture2: Basic Linear Algebra & Probability. Vector. Vector Operations

10-701/ Recitation : Linear Algebra Review (based on notes written by Jing Xiang)

Linear Algebra and Matrices

Matrices. Chapter Definitions and Notations

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

Jim Lambers MAT 610 Summer Session Lecture 1 Notes

Basic Concepts in Linear Algebra

EE731 Lecture Notes: Matrix Computations for Signal Processing

Linear Algebra - Part II

1. Linear systems of equations. Chapters 7-8: Linear Algebra. Solution(s) of a linear system of equations (continued)

Linear Equations and Matrix

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

ELE/MCE 503 Linear Algebra Facts Fall 2018

Matrices A brief introduction

Linear Algebra. Shan-Hung Wu. Department of Computer Science, National Tsing Hua University, Taiwan. Large-Scale ML, Fall 2016

M. Matrices and Linear Algebra

Review of Basic Concepts in Linear Algebra

Transcription:

Review of Linear Algebra Dr Gerhard Roth COMP 40A Winter 05 Version

Linear algebra Is an important area of mathematics It is the basis of computer vision Is very widely taught, and there are many resources and books available We only focus on the basics Need to understand matrices, vectors and their basic operations

Linear Equations A system of linear equations, eg 4 4 can be written in matri form, m rows and n columns: 4 4 or in general: A b

Matri A matri is an m n array of numbers ij mn m m n n a a a a a a a a a a A Eample: 0 7 0 9 3 4 4 5 3 A

Matri Arithmetic Matri addition A mn B mn a ij b ij m n Matri multiplication A Matri transpose n mnbn p C c m p ij k T A a T ji T T A B A B T T AB B A T a ik b kj

Review of Vectors and Matrices Matrices An m n matri has m rows and n columns (height by width, y by ) Matri A = Matri B = Matri C = Q: Epress A,B,C as m n

Review of Vectors and Matrices Matrices An m n matri has m rows and n columns (height by width, y by ) Matri A = Matri B = Matri C = Q: Epress A,B,C as m n A: Matri A is 3 3 Matri B is 4 Matri C is 4 3

Review of Vectors and Matrices Matrices An m n matri has m rows and n columns (height by width, y by ) Matri A = Matri B = Matri C = Q: Epress A,B,C as m n A: Matri A is 3 3 Matri B is 4 Matri C is 4 3 Q: Which matrices can be multiplied by each other?

Review of Vectors and Matrices Matrices An m n matri has m rows and n columns (height by width, y by ) Matri A = Matri B = Matri C = Q: Epress A,B,C as m n A: Matri A is 3 3 Matri B is 4 Matri C is 4 3 Q: Which matrices can be multiplied by each other? Hint: # cols of first matri = # rows of second matri

Review of Vectors and Matrices Matrices An m n matri has m rows and n columns (height by width, y by ) Matri A = Matri B = Matri C = Q: Epress A,B,C as m n A: Matri A is 3 3 Matri B is 4 Matri C is 4 3 Q: Which matrices can be multiplied by each other? Hint: # cols of first matri = # rows of second matri Answer: B C C A

Review of Vectors and Matrices Calculate CA Matri C Matri A =?

Review of Vectors and Matrices Calculate CA Matri C Matri A =? 4 3 3 3 matri matri Q: But first What will size of result be?

Review of Vectors and Matrices Calculate CA Matri C Matri A =? 4 3 3 3 matri matri Q: But first What will size of result be? HINT: st matri must have as many columns as nd matri has rows to allow matri multiplication

Review of Vectors and Matrices Calculate CA Matri C Matri A =? 4 3 3 3 matri matri Q: But first What will size of result be? HINT: st matri must have as many columns as nd matri has rows to allow matri multiplication A: Result has same number of rows as first matri, and same number of columns as second matri

Review of Vectors and Matrices Calculate CA Matri C Matri A =? 4 3 3 3 matri matri Q: But first What will size of result be? HINT: st matri must have as many columns as nd matri has rows to allow matri multiplication A: Result has same number of rows as first matri, and same number of columns as second matri A: Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 3b + 4e + 5h 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 3b + 4e + 5h rc + sf + tl 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 3b + 4e + 5h rc + sf + tl uc + vf + yl 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 3b + 4e + 5h rc + sf + tl uc + vf + yl zc + f + l 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate CA Matri C Matri A = ra + sd + tg ua + vd + yg za + d + g 3a + 4d + 5g rb + se + th ub + ve + yh zb + e + h 3b + 4e + 5h rc + sf + tl uc + vf + yl zc + f + l 3c + 4f + 5l 4 3 3 3 matri matri Result is 4 3

Review of Vectors and Matrices Calculate BC Matri B Matri C =? 4 4 3 matri matri Q: But first What will size of result be? HINT: st matri must have as many columns as nd matri has rows to allow matri multiplication A: Result has same number of rows as first matri, and same number of columns as second matri

Review of Vectors and Matrices Calculate BC Matri B Matri C =? 4 4 3 matri matri Q: But first What will size of result be? HINT: st matri must have as many columns as nd matri has rows to allow matri multiplication A: Result has same number of rows as first matri, and same number of columns as second matri A: Result is 3

Review of Vectors and Matrices Calculate BC Matri B Matri C = 4 4 3 matri matri Result is 3 jr + ku + lz + m3 nr + ou + pz + q3 js + kv + l + m4 ns + ov + p + q4 jt + ky + l + m5 nt + oy + p + q5

Multiplication not commutative AB BA Matri multiplication is not commutative Eample: 9 9 7 5 6 3 5 0 7 3 8 3 5 5 6

Symmetric Matri We say matri A is symmetric if A T A Eample: A 4 4 5 A symmetric matri has to be a square matri

Inverse of matri If A is a square matri, the inverse of A, written A - satisfies: AA I A A I Where I, the identity matri, is a diagonal matri with all s on the diagonal I 0 0 I 3 0 0 0 0 0 0

Vectors matrices with one column n 5 3 eg The length or the norm of a vector is n 38 5 3 eg A vector is an n by matri, it is a column in our book

Vector Arithmetic v u v u v v u u v u v u v u v v u u v u Vector addition Vector subtraction Multiplication by scalar u u u u u

Dot Product (inner product) 5 3 a 3 4 b 9 5 3) ( 3 4 3 4 5 3 b a b a T n n T b a b a a b b a b a

Vectors: Dot Product (Inner product) T A B A B a b c e ad be cf d f Think of the dot product as a matri multiplication T A A A aa bb cc The magnitude is the dot product of a vector with itself A B A B cos() The dot product is also related to the angle between the two vectors

Vectors: Outer product Here u is an m by column, v is n by column so the outer product is m by n

Trace of Matri The trace of a matri: Tr( A) n i a ii

Orthogonal Matri A matri A is orthogonal if A T A I or A T A Eample: A cos sin sin cos

Matri Transformation (and projections) A matri-vector multiplication transforms one vector to another m n n m b A 6 6 4 7 3 4 3 5 Eample:

Coordinate Rotation r r y ' ' cos sin sin r cos r y

Vectors and Points Two points in a Cartesian coordinate system define a vector P(,y) Q(,y) y v y y v P(,y) Q(,y) y v A point can also be represented as a vector, defined by the point and the origin (0,0) P Q v 0 0 y y P 0 0 y y Q or v P Q Note: point and vector are different; vectors do not have positions

Least Squares When m>n for an m-by-n matri A, A b In this case, we look for an approimate solution We look for vector such that has no solution A b is as small as possible This is called the least squares solution

Least Squares Least squares solution of linear system of equations Normal equation: A T A A A b T A A is square and symmetric T b The Least Square solution makes A b minimal ( A A) T A T b

Least Square Fitting of a Line y d m y m c y d c y d c m y m y y d c The best solution c, d is the one that minimizes: ) ( ) ( m d m c y d c y A y E Line equations: y A

Least Square Fitting - Eample y P=(-,), P=(,), P3=(,3) Problem: find the line that best fit these three points: Solution: 3 d c d c d c 3 d c b A A A T T 6 5 6 3 d c or is The solution is and best line is 7 4 7 9, d c y 7 4 7 9

Homogeneous System m linear equations with n unknowns A = 0 Assume that m >= n- and rank(a) = n- Trivial solution is = 0 but there are more If we have a given solution, st A = 0 then c * is also a solution since A(c* ) = 0 Need to add a constraint on, Usually make a unit vector T Can prove that the solution of A = 0 satisfying this constraint is the eigenvector corresponding to the only zero eigenvalue of that matri A T A

Homogeneous System This solution can be computed using the eigenvector or SVD routine Find the zero eigenvalue (or the eigenvalue almost zero) Then the associated eigenvector is the solution And any scalar times is also a solution

Linear Independence A set of vectors is linear dependant if one of the vectors can be epressed as a linear combination of the other vectors A set of vectors is linearly independent if none of the vectors can be epressed as a linear combination of the other vectors n n k k k k k v v v v v

Eigenvalue and Eigenvector We say that is an eigenvector of a square matri A if A is called eigenvalue and is called eigenvector The transformation defined by A changes only the magnitude of the vector Eample: 5 5 5 4 3 4 4 3 and 5 and are eigenvalues, and and are eigenvectors

Properties of Eigen Vectors If,,, q are distinct eigenvalues of a matri, then the corresponding eigenvectors e,e,,e q are linearly independent A real, symmetric matri has real eigenvalues with eigenvectors that can be chosen to be orthonormal

SVD: Singular Value Decomposition T A UDV An mn matri A can be decomposed into: U is mm, V is nn, both of them have orthogonal columns: I U U T D is an mn diagonal matri I V V T Eample: 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0

Singular Value Decomposition Any m by n matri A can be written as product of three matrices A = UDV T The columns of the m by m matri U are mutually orthogonal unit vectors, as are the columns of the n by n matri V The m by n matri D is diagonal, and the diagonal elements, are called the singular values i It is the case that n A matri is non-singular if and only all of the singular values are not zero The condition number of the matri is If the condition number is large, then then matri is almost singular and is called ill-conditioned 0 n

Singular Value Decomposition The rank of a square matri is the number of linearly independent rows or columns For a square matri (m = n) the number of non-zero singular values equals the rank of the matri If A is a square, non-singular matri, it s inverse can be written as T T where A VD The squares of the non zero singular values are the non-zero eigenvalues of both the n by n matri A T A T and of the m by m matri The columns of U are the eigenvectors of The columns of V are the eigenvectors of U AA A UDV T AA A A T