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

Similar documents
Matrix & Linear Algebra

Math Camp Lecture 4: Linear Algebra. Xiao Yu Wang. Aug 2010 MIT. Xiao Yu Wang (MIT) Math Camp /10 1 / 88

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

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

Elementary maths for GMT

Math Linear Algebra Final Exam Review Sheet

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

Linear Algebra March 16, 2019

2. Every linear system with the same number of equations as unknowns has a unique solution.

MATH 2331 Linear Algebra. Section 2.1 Matrix Operations. Definition: A : m n, B : n p. Example: Compute AB, if possible.

Elementary Row Operations on Matrices

Lecture Notes in Linear Algebra

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Phys 201. Matrices and Determinants

Review of Linear Algebra

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

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

MATH2210 Notebook 2 Spring 2018

MATH 2331 Linear Algebra. Section 1.1 Systems of Linear Equations. Finding the solution to a set of two equations in two variables: Example 1: Solve:

MATH 213 Linear Algebra and ODEs Spring 2015 Study Sheet for Midterm Exam. Topics

Math 313 Chapter 1 Review

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

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

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

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

MAT 2037 LINEAR ALGEBRA I web:

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

Introduction to Matrices

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

POLI270 - Linear Algebra

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

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.

February 20 Math 3260 sec. 56 Spring 2018

3.4 Elementary Matrices and Matrix Inverse

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

MATH 1210 Assignment 4 Solutions 16R-T1

Chapter 7. Linear Algebra: Matrices, Vectors,

Applied Matrix Algebra Lecture Notes Section 2.2. Gerald Höhn Department of Mathematics, Kansas State University

CSL361 Problem set 4: Basic linear algebra

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

MAT Linear Algebra Collection of sample exams

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

Math 4A Notes. Written by Victoria Kala Last updated June 11, 2017

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

Matrix operations Linear Algebra with Computer Science Application

Matrices and Matrix Algebra.

Lecture 6: Geometry of OLS Estimation of Linear Regession

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Linear Algebra Highlights

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Chapter 2 Notes, Linear Algebra 5e Lay

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

MAC Module 2 Systems of Linear Equations and Matrices II. Learning Objectives. Upon completing this module, you should be able to :

ECON 186 Class Notes: Linear Algebra

Knowledge Discovery and Data Mining 1 (VO) ( )

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

MATH 106 LINEAR ALGEBRA LECTURE NOTES

MATH 152 Exam 1-Solutions 135 pts. Write your answers on separate paper. You do not need to copy the questions. Show your work!!!

Matrices A brief introduction

Linear Algebra Review. Vectors

NOTES on LINEAR ALGEBRA 1

Introduction to Matrix Algebra

MTH 464: Computational Linear Algebra

CS 246 Review of Linear Algebra 01/17/19

Systems of Linear Equations. By: Tri Atmojo Kusmayadi and Mardiyana Mathematics Education Sebelas Maret University

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Matrices and systems of linear equations

CHAPTER 6. Direct Methods for Solving Linear Systems

Linear Algebra. James Je Heon Kim

1 Last time: determinants

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

Review Let A, B, and C be matrices of the same size, and let r and s be scalars. Then

Linear Algebra V = T = ( 4 3 ).

Chapter 2: Matrix Algebra

Matrix Algebra for Engineers Jeffrey R. Chasnov

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES

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

Kevin James. MTHSC 3110 Section 2.2 Inverses of Matrices

LECTURES 14/15: LINEAR INDEPENDENCE AND BASES

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

Linear Algebra Homework and Study Guide

Chapter 3. Vector spaces

Inverting Matrices. 1 Properties of Transpose. 2 Matrix Algebra. P. Danziger 3.2, 3.3

GEOMETRY OF MATRICES x 1

Linear algebra I Homework #1 due Thursday, Oct Show that the diagonals of a square are orthogonal to one another.

MATH 2360 REVIEW PROBLEMS

A Review of Matrix Analysis

Digital Workbook for GRA 6035 Mathematics

APPENDIX: MATHEMATICAL INDUCTION AND OTHER FORMS OF PROOF

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

OHSx XM511 Linear Algebra: Solutions to Online True/False Exercises

Systems of Linear Equations and Matrices

1 Last time: inverses

SAMPLE OF THE STUDY MATERIAL PART OF CHAPTER 1 Introduction to Linear Algebra

Math 54 HW 4 solutions

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

Linear Systems and Matrices

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

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

Transcription:

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

1 Solving Systems of Linear Equations 2 Vectors and Vector Spaces 3 Matrices 4 Least Squares

Systems of Linear Equations Definition A linear equation in the variables x 1,... x n is an equation that can be written in the form a 1 x 1 + a 2 x 2 + + a n x n = b where b and the coefficients a 1,... a n are real or complex numbers. The subscript n may be any positive integer. Definition A system of linear equations (or a linear system) is a collection of one or more linear equations involving the same variables say, x 1,..., x n. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 1 / 51

Properties of systems of linear equations Systems of linear equations fall into one of three camps A single solution (the two lines intersect at one point) No solution (the two lines are exactly parallel but are shifted by some constant) An infinite number of solutions Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 2 / 51

Graphical View of the Solutions x + y + z = 3 x + 2y 3z = 2 x + y + z = 5 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 3 / 51

1 Solving Systems of Linear Equations 2 Vectors and Vector Spaces 3 Matrices 4 Least Squares

Definition Properties of Vector An ordered list of number in R: v 1 v = ( ) v 2 v 1 v 2... v n, v =. Properties Vector Addition v n (u1 ) + v 1 u 2 + v 2 u k + v n Scalar Multiplication cv = ( ) cv 1 cv 2... cv n Vector Inner Product u v = u 1 v 1 + u 2 v 2 + + u n v n = Vector Norm n u i v i i=1 v = v v = v 1 v 1 + v 2 v 2 + + v n v n Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 4 / 51

Functions of Vectors C P G I V 3 2 4 5 6 6 7 3 3 1 5 6 4 1 5 3 5 5 5 6 C = β 1 P + β 2 G + β 3 I + β 4 V Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 5 / 51

Functions of Vectors Definition (Linear combinations) The vector u is a linear combination of the vectors v 1, v 2,, v k if Definition (Linear independence) u = c 1 v 1 + c 2 v 2 + + c k v k A set of vectors v 1, v 2,, v k is linearly independent if the only solution to the equation c 1 v 1 + c 2 v 2 + + c k v k = 0 is c 1 = c 2 = = c k = 0. If another solution exists, the set of vectors is linearly dependent. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 6 / 51

Systems of Linear Equations We might have a system of m equations with n unknowns a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2... a m1 x 1 + a m2 x 2 + + a mn x n = b m A solution to a linear system of m equations in n unknowns is a set of n numbers x 1, x 2,, x n that satisfy each of the m equations. Can we rewrite it some way? Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 7 / 51

Elementary row (column) operations Definition Elementary row (column) operations on an m n matrix A includes the following. 1 Interchange rows (columns) r and s of A. 2 Multiply row (column) r of A by a nonzero scalar k 0. 3 Add k times row (column) r of A to row (column) s of A where r s. An m n matrix A is said to be row (column) equivalent to an m n matrix B if B can be obtained by applying a finite sequence of elementary row (column) operations to A. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 8 / 51

Elementary equation operations Elementary equation operations transform the equations of a linear system while maintaining an equivalent linear system equivalent in that the same values of x j solve the original and transformed systems, i.e., transformed systems look different but have the same properties. These operations are: 1 Interchanging two equations, 2 Multiplying two sides of an equation by a constant, and 3 Adding equations to each other Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 9 / 51

Vector Space Definition A real vector space is a set of vectors together with rules for vector addition and for multiplication by real numbers It s a set of vectors There are rules Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 10 / 51

Subspace Definition A subspace of a vector space is a set of vectors (including 0) that satisfies two requirements: If V and W are vectors in the subspace and c is any scalar, then 1 V + W is in the subspace 2 cv is in the subspace All linear combinations stay in the subspace Subspace must go through the origin Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 11 / 51

Questions Is a identity matrix a subspace by itself? Is the union of a line and a plane (the line is not on the plane) a subspace? Is the intersection of two subspaces a subspace? Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 12 / 51

Column Space Suppose A is a m n matrix. Definition The column space consists of all linear combinations of the columns. The combinations are all possible vectors Ax. They fill the column space of A, denoted by C(A). The system Ax = b is solvable iff b is in C(A). C(A) is a subspace of R m (why C(A) is a subspace?) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 13 / 51

Spanning Definition Subspace SS is a span of S if it contains all combinations of vectors in S V is a vector space, e.g., R 3 S is a set of vectors in V (probably not a subspace) SS is the span of S, a subspace of V Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 14 / 51

Null Space Suppose A is a m n matrix. Definition The null space of A, denoted by N(A), consists of all solutions to Ax = 0. N(A) is subspace of R n. Why? Remember, C(A) is a subspace of R m Any null space must include the origin Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 15 / 51

Reduced Row Echelon Form Definition A rectangular matrix is in echelon form (or row echelon form) if it has the following three properties: 1 All nonzero rows are above any rows of all zeros 2 Each leading entry of a row is in a column to the right of the leading entry of the row above it. 3 All entries in a column below a leading entry are zeros. If a matrix in echelon form satisfies the following additional conditions, then it is in reduced echelon form (or reduced row echelon form) 4 The leading entry in each nonzero row is 1. 5 Each leading 1 is the only nonzero entry in its column Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 16 / 51

Pivots Definition A pivot position in a matrix A is a location in A that corresponds to a leading 1 in the reduced echelon form of A. A pivot column is a column of A that contains a pivot position A = 0 3 6 4 9 1 2 1 3 1 2 3 0 3 1 1 4 5 9 7 1 4 5 9 7 0 2 4 6 6 0 0 0 5 0 0 0 0 0 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 17 / 51

Special Solutions Every free column of an echelon matrix leads to a special solution. The free variable equals 1 and the other free variables equal 0. Back substitution solves Ax = 0 The complete solution to Ax = 0 is a combination of the special solutions If n > m then A has at least one column without pivots, giving a special solution. So there are nonzero vectors x in N(A) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 18 / 51

Rank 1 0 5 0 1 1 0 0 0 The rank r of A is the number of pivots The r pivot columns are not combinations of earlier columns The n r free columns are combinations of the pivot columns Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 19 / 51

Augmented Matrices Instead of writing out all of the x terms of each matrix, we can write the augmented matrix which is just the matrix representation of Ax = b where x is a vector (x 1, x 2,, x n ). Often times we ll just work with the augmented matrix in RREF, [R d], e.g., 1 0 0 2 0 1 1 4 0 0 0 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 20 / 51

One Particular Solution 1 Choose the free variable(s) to be zero (e.g., x 3 = 0) 2 Nonzero equations give the values of the pivot variables (e.g., x 1 = 2, x 2 = 4) 3 The particular solution in the following case is ( 2, 4, 0) 1 0 0 2 0 1 1 4 0 0 0 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 21 / 51

The Complete Solution of Ax = b The Complete Solution of Ax = b is One particular solution Add the null space x p + x n 1 0 0 2 0 1 1 4 0 0 0 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 22 / 51

Rank and the Complete Solution of Ax = b Ax = b is solvable iff the last m r equations reduce to 0 = 0 1 0 0 2 0 1 1 4 0 0 0 0 Full column rank r = n means no free variables: one solution or none 1 0 2 1 0 2 0 1 4 0 1 4 0 0 0 0 0 1 Full row rank r = m means one solution if m = n or infinitely many if m < n [ 1 0 0 2 0 1 1 3 ] 1 0 0 2 0 1 0 3 0 0 1 1 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 23 / 51

Full Column Rank Every matrix A with full column rank (r = n) has the following properties All columns of A are pivot columns No free variables or special solutions N(A) contains only the zero vector x = 0 Ax = b has zero or only one solution A few variables, many many equations 1 0 2 [R d] = 0 1 1 = 0 1 1 1 0 2 0 1 1 0 0 2 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 24 / 51

Full Row Rank Every matrix A with full column rank (r = m) has the following properties All row have pivots Ax = b has a solution for every right side b The column space is the whole space of R m There are n r = n m special solutions in N(A) A few equations, many many variables [ ] 1 0 3 2 [R d] = 0 1 2 1 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 25 / 51

Four Cases Ranks RREF A Ax = b r = m = n [I ] Square and invertible 1 solution r = m < n [I F ] Short and wide solutions r = n < m r < m, r < n [ ] I 0 [ ] I F 0 0 Tall and thin Not full rank 0 or 1 solution 0 or solutions Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 26 / 51

Linear Independence and Spanning, Again Definition The columns of a matrix A are linearly independent when the only solutions to Ax = 0 is x = 0. No other combination x of the columns gives the zero vector. Definition A set of vectors spans a space if their linear combinations fill the space 1 0 0 A = 0 1 0 0 0 1 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 27 / 51

Basis Definition A basis for a vector space is a sequence of vectors with two properties: The basis vectors are linearly independent They span the space The columns of every invertible n by n matrix give a basis for R n, why? Can you list one basis for the space of all 2 by 2 matrix? Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 28 / 51

Dimensions Definition The dimension of a space is the number of vectors in very basis The dimension of the whole n by n matrix space is n 2 The dimension of the subspace of upper triangular matrices is (n 2 + n)/2 The dimension of the subspace of diagonal matrices is n The dimension of the subspace of symmetric matrices is (n 2 + n)/2 Dimension of column space + dimension of null space = dimension of R n, why? Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 29 / 51

In Summary 1 Independent vectors: no extra vectors 2 Spanning a space: enough vectors to produce the rest 3 Basis for a space: not too many, not too few 4 Dimension of a space: the number of vectors in a basis Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 30 / 51

1 Solving Systems of Linear Equations 2 Vectors and Vector Spaces 3 Matrices 4 Least Squares

Matrix A matrix is an array of mn real numbers arranged in m rows by n columns. a 11 a 12 a 1n a 21 a 22 a 2n A =...... a m1 a m2 a mn Vectors are special cases of matrices; a column vector of length k is a k 1 matrix, while a row vector of the same length is a 1 k matrix. You can also think of larger matrices as being made up of a collection of row or column vectors. For example, A = ( a 1 a 2 a m ) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 31 / 51

Matrix Operations Let A and B be m n matrices. 1 (equality) A = B if a ij = b ij. 2 (addition) C = A + B if c ij = a ij + b ij and C is an m n matrix. 3 (scalar multiplication) Given k R, C = ka if c ij = ka ij where C is an m n matrix. 4 (product) Let C be an n l matrix. D = AC if d ij = n k=1 a ikc kj and D is an m l matrix. 5 (transpose) C = A if c ij = a ji and C is an n m matrix. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 32 / 51

Matrix Multiplication a c e b ( ) aa + bc d A B = ca + dc C D f ea + fc ab + bd cb + dd eb + fd The number of columns of the first matrix must equal the number of rows of the second matrix. If so they are conformable for multiplication. The sizes of the matrices (including the resulting product) must be (m k)(k n) = (m n) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 33 / 51

Matrix Algebra Laws 1 Associative (A + B) + C = A + (B + C); (AB)C = A(BC) 2 Commutative A + B = B + A 3 Distributive A(B + C) = AB + AC; (A + B)C = AC + BC Note Commutative law for multiplication does not hold the order of multiplication matters: AB BA Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 34 / 51

Rules of Matrix Transpose 1 (A + B) T = A T + B T 2 (A T ) T = A 3 (sa) T = sa T 4 (AB) T = B T A T Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 35 / 51

Square Matrix Square matrices have the same number of rows and columns; a k k square matrix is referred to as a matrix of order k. Definition Let A be an m n matrix. 1 A is called a square matrix if n = m. 2 A is called symmetric if A = A. 3 A square matrix A is called a diagonal matrix if a ij = 0 for i j. A is called upper triangular if a ij = 0 for i > j and called lower triangular if a ij = 0 for i < j. 4 A diagonal matrix A is called an identity matrix if a ij = 1 for i = j and is denoted by I n. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 36 / 51

Examples of the Square Matrix 1 Symmetric Matrix: A matrix A is symmetric if A = A T ; this implies that a ij = a ji for all i and j. ( ) 4 2 1 1 2 A = = A T, B = 2 1 3 = B 2 1 1 3 1 2 Diagonal Matrix: A matrix A is diagonal if all of its non-diagonal entries are zero; formally, if a ij = 0 for all i j ( ) 4 0 0 1 0 A =, B = 0 1 0 0 2 0 0 1 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 37 / 51

Examples of the Square Matrix 1 Triangular Matrix: A matrix is triangular one of two cases. If all entries below the diagonal are zero (a ij = 0 for all i > j), it is upper triangular. Conversely, if all entries above the diagonal are zero (a ij = 0 for all i < j), it is lower triangular. 1 0 0 1 7 4 A LT = 4 2 0, A UT = 0 3 9 3 2 5 0 0 3 2 Identity Matrix: The n n identity matrix I n is the matrix whose diagonal elements are 1 and all off-diagonal elements are 0. Examples: ( ) 1 0 0 1 0 I 2 =, I 0 1 3 = 0 1 0 0 0 1 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 38 / 51

Trace Definition If A is an n n matrix, then the trace of A denoted by tr(a) is defined as the sum of all the main diagonal elements of A. That is, tr(a) = n i=1 a ii. Properties of the trace operator: If A and B are square matrices of order k, then 1 tr(a + B) = tr(a) + tr(b) 2 tr(a T ) = tr(a) 3 tr(sa) = str(a) 4 tr(ab) = tr(ba) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 39 / 51

Matrix Inverse Definition Inverse Matrix: An n n matrix A is invertible if there exists an n n matrix A 1 such that AA 1 = A 1 A = I n A 1 is the inverse of A. If there is no such A 1, then A is noninvertible (another term for this is singular ). Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 40 / 51

Matrix Inverse Theorem (Uniqueness of Inverse) The inverse of a matrix, if it exists, is unique. We denote the unique inverse of A by A 1. Theorem (Properties of Inverse) Let A and B be nonsingular n n matrices. 1 AB is nonsingular and (AB) 1 = B 1 A 1. 2 A 1 is nonsingular and (A 1 ) 1 = A. 3 (A ) 1 = (A 1 ). Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 41 / 51

Shortcut for 2 2 It turns out that there is a shortcut for 2x2 matrices that are invertible: [ ] [ ] a b A =, then A 1 1 d b = c d ad bc c a Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 42 / 51

Solving Linear Systems Matrix representation of a linear system Ax = b If A is an n n matrix,then Ax = b is a system of n equations in n unknowns. If A is invertible then A 1 exists. To solve this system, we can left multiply each side by A 1. A 1 (Ax) = A 1 b (A 1 A)x = A 1 b I n x x = A 1 b = A 1 b Hence, given A and b and given that A is nonsingular, then x = A 1 b is a unique solution to this system. Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 43 / 51

Determinants If the determinant is non-zero then the matrix is invertible. For a 1 1 matrix A = a the determinant is simply a. We want the determinant to equal zero when the inverse does not exist. Since the inverse of a, 1/a, does not exist when a = 0. a = a ( ) a11 a For a 2 2 matrix A = 12, the determinant is defined as a 21 a 22 a 11 a 12 a 21 a 22 = det A = a 11a 22 a 12 a 21 == a 11 a 22 a 12 a 21 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 44 / 51

Properties of determinants 1 A = A T 2 Interchanging rows changes the sign of the determinant 3 If two rows of A are exactly the same, then A = 0 4 If a row of A has all 0 then A = 0 5 If c 0 is some constant then A = ca 6 A square matrix is nonsingular iff its determinant is 0 7 AB = A B Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 45 / 51

Bringing It Together Theorem Let A be an n n matrix. Then the following statements are equivalent to each other. A is an invertible matrix. A ir row equivalent to the n n identity matrix. The equation Ax = 0 has only the trivial solution. The equation Ax = b has at least one solution for each b in R n. There is an n n matrix C such that AC=I. There is an n n matrix D such that DA=I. A T is an invertible matrix. rank(a)=n. det(a) 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 46 / 51

1 Solving Systems of Linear Equations 2 Vectors and Vector Spaces 3 Matrices 4 Least Squares

Geometrics of Ordinary Least Square One way is to think about the OLS is to find (or approximate) solutions to Ax = b, or X b = y X is a n by k matrix When n > k, a solution does not exist Two ways to think about it 1 Find a vector ˆb such that X ˆb is closest to y 2 Project y R n onto subspace C(X ), a k-dimensional subspace in R n x 11 x 12 x 1k b 1 y 1 x 21 x 22 x 2k b 2....... = y 2. x n1 x n2 x nk b k y k Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 47 / 51

First Interpretation Find a vector ˆb such that X ˆb is closest to y X = [1 income ethnic] X ˆb is on a plane (why?) 3D e 2.0 2.5 3.0 3.5 4.0 4.5 5.0 1 2 3 4 5 6 7 0.0 0.2 0.4 0.6 0.8 1.0 Income EthnicHeterogeneity Democracy Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 48 / 51

Projection If is not super intuitive because humans do not have intuitions for high-dimensional spaces We denote the projection of a vector as p = Pb, P is called the projection matrix b p is orthogonal to p Definition Vectors V and W are orthogonal if V W = 0 Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 49 / 51

Projection onto a Subspace Problem: Given x 1, x 2,, x k are n 1 vectors (k variables), find the combination ˆb 1 x 1 + ˆb 1 x 2 + + ˆb k x k closest to a given vector y We know that the error vector y X ˆb is orthogonal to C(X ) x 1(y X ˆb) = 0. x k (y X ˆb) = 0 or X (y X ˆb) = 0 ˆb = (X X ) 1 X y P = X (X X ) 1 X Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 50 / 51

Residual Maker and OLS Mechanics The residual maker: M = I P = I X (X X ) 1 X M is both symmetric and idempotent M 2 = M (why?) MX = 0 (why?) ŷ and residual e are orthogonal (why?) y = Py + My y y = y P Py + y M My = ŷ ŷ + e e e e = e y = y e (why?) y P Py = ˆb X X ˆb = ˆb X y = y X ˆb (why?) Yiqing Xu (MIT) Linear Algebra Aug 26, 2014 51 / 51