1 Introduction to Matrices



Similar documents
MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

Lecture 2 Matrix Operations

Linear Algebra Review. Vectors

Linear Algebra Notes for Marsden and Tromba Vector Calculus

MAT188H1S Lec0101 Burbulla

Introduction to Matrix Algebra

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix.

Chapter 7. Matrices. Definition. An m n matrix is an array of numbers set out in m rows and n columns. Examples. (

x = + x 2 + x

Math 312 Homework 1 Solutions

MATH 304 Linear Algebra Lecture 9: Subspaces of vector spaces (continued). Span. Spanning set.

Lecture Notes 2: Matrices as Systems of Linear Equations

Systems of Linear Equations

LINEAR ALGEBRA. September 23, 2010

Orthogonal Diagonalization of Symmetric Matrices

5. Orthogonal matrices

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Introduction to Matrices for Engineers

1 VECTOR SPACES AND SUBSPACES

Data Mining: Algorithms and Applications Matrix Math Review

Linear Algebra: Determinants, Inverses, Rank

[1] Diagonal factorization

NOTES ON LINEAR TRANSFORMATIONS

F Matrix Calculus F 1

Section Inner Products and Norms

MATH APPLIED MATRIX THEORY

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

Inner Product Spaces

Name: Section Registered In:

Orthogonal Projections

Solving Linear Systems, Continued and The Inverse of a Matrix

α = u v. In other words, Orthogonal Projection

Problem Set 5 Due: In class Thursday, Oct. 18 Late papers will be accepted until 1:00 PM Friday.

( ) which must be a vector

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

THREE DIMENSIONAL GEOMETRY

Linear Algebraic Equations, SVD, and the Pseudo-Inverse

Inner product. Definition of inner product

Vector and Matrix Norms

Matrix Differentiation

T ( a i x i ) = a i T (x i ).

MA106 Linear Algebra lecture notes

Math 215 HW #6 Solutions

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Typical Linear Equation Set and Corresponding Matrices

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION

Solution to Homework 2

Lecture notes on linear algebra

Brief Introduction to Vectors and Matrices

Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices

Using row reduction to calculate the inverse and the determinant of a square matrix

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression

Similar matrices and Jordan form

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Notes on Symmetric Matrices

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components

by the matrix A results in a vector which is a reflection of the given

October 3rd, Linear Algebra & Properties of the Covariance Matrix

CONTROLLABILITY. Chapter Reachable Set and Controllability. Suppose we have a linear system described by the state equation

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

Solving Systems of Linear Equations

Methods for Finding Bases

DATA ANALYSIS II. Matrix Algorithms

MAT 200, Midterm Exam Solution. a. (5 points) Compute the determinant of the matrix A =

Recall the basic property of the transpose (for any A): v A t Aw = v w, v, w R n.

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Solving simultaneous equations using the inverse matrix

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances

A =

Similarity and Diagonalization. Similar Matrices

Applied Linear Algebra I Review page 1

SF2940: Probability theory Lecture 8: Multivariate Normal Distribution

Notes on Linear Algebra. Peter J. Cameron

Au = = = 3u. Aw = = = 2w. so the action of A on u and w is very easy to picture: it simply amounts to a stretching by 3 and 2, respectively.

LINEAR ALGEBRA W W L CHEN

Notes on Determinant

GCE Mathematics (6360) Further Pure unit 4 (MFP4) Textbook

9 MATRICES AND TRANSFORMATIONS

Linear Maps. Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (February 5, 2007)

Matrix Representations of Linear Transformations and Changes of Coordinates

Inner products on R n, and more

8.2. Solution by Inverse Matrix Method. Introduction. Prerequisites. Learning Outcomes

1 Sets and Set Notation.

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors

GENERATING SETS KEITH CONRAD

Linear Algebra I. Ronald van Luijk, 2012

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

Inner Product Spaces and Orthogonality

Physics 235 Chapter 1. Chapter 1 Matrices, Vectors, and Vector Calculus

Notes on Orthogonal and Symmetric Matrices MENU, Winter 2013

Finite dimensional C -algebras

Linear Algebra: Vectors

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

7.4. The Inverse of a Matrix. Introduction. Prerequisites. Learning Style. Learning Outcomes

Transcription:

1 Introduction to Matrices In this section, important definitions and results from matrix algebra that are useful in regression analysis are introduced. While all statements below regarding the columns of matrices can also be said of rows, in regression applications we will typically be focusing on the columns. A matrix is a rectangular array of numbers. The order or dimension of the matrix is the number of rows and columns that make up the matrix. The rank of a matrix is the number of linearly independent columns (or rows) in the matrix. A subset of columns is said to be linearly independent if no column in the subset can be written as a linear combination of the other columns in the subset. A matrix is full rank (nonsingular) if there are no linear dependencies among its columns. The matrix is singular if lineardependencies exist. The column space of a matrix is the collection of all linear combinations of the columns of a matrix. The following are important types of matrices in regression: Vector Matrix with one row or column Square Matrix Matrix where number of rows equals number of columns Diagonal Matrix Square matrix where all elements off main diagonal are 0 Identity Matrix Diagonal matrix with 1 s everywhere on main diagonal Symmetric Matrix Matrix where element a ij = a ji i, j Scalar A single ordinary number The transpose of a matrix is the matrix generated by interchanging the rows and columns of the matrix. If the original matrix is A, then its transpose is labelled A. For example: 2 1 A = 4 7 7 2 Matrix addition (subtraction) can be performed on two matrices as long as they are of equal order (dimension). The new matrix is obtained by elementwise addition (subtraction) of the two matrices. For example: B = 1 3 0 2 4 8 A + B = 3 7 7 3 11 10 Matrix multiplication can be performed on two matrices as long as the number of columns of the first matrix equals the number of rows of the second matrix. The resulting has the same number of rows as the first matrix and the same number of columns as the second matrix. If

C = AB and A has s columns and B has s rows, the element in the i th row and j th column of C, which we denote c ij is obtained as follows (with similar definitions for a ij and b ij ): c ij = a i1 b 1j + a i2 b 2j + a is b sj = s a ik b kj k=1 For example: C = AB = B = 1 5 6 2 0 1 3 3 3 2(1) + 4(2) + 7(3) 2(5) + 4(0) + 7(3) 2(6) + 4(1) + 7(3) 1(1) + 7(2) + 2(3) 1(5) + 7(0) + 2(3) 1(6) + 7(1) + 2(3) = 31 31 37 21 11 19 Note that C has the same number of rows as A and the same number of columns as B. Note that in general AB BA; in fact, the second matrix may not exist due to dimensions of matrices. However, the following equality does hold: (AB) = B A. Scalar Multiplication can be performed between any scalar and any matrix. Each element of the matrix is multiplied by the scalar. For example: 4 8 14 2 2 14 4 The determinant is scalar computed from the elements of a matrix via well defined (although rather painful) rules. Determinants only exist for square matrices. The determinant of a matrix A is denoted as A. For a scalar (a 1 1 matrix): A = A. Fora2 2 matrix: A = a 11 a 22 a 12 a 21. For n n matrices (n >2): 1. A rs (n 1) (n 1) matrix with row r and column s removed from A 2. A rs the minor of element a rs 3. θ rs =( 1) r+s A rs the cofactor of element a rs 4. The determinant is obtained by summing the product of the elements and cofactors for any row or column of A. By using row i of A, we get A = n j=1 a ij θ ij Example Determinant of a 3 3 matrix We compute the determinant of a 3 3 matrix, making use of its first row. 10 5 2 6 8 0 2 5 1

a 11 =10 A 11 = a 12 =5 A 12 = a 13 =2 A 13 = 8 0 5 1 6 0 2 1 6 8 2 5 A 11 = 8(1) 0(5) = 8 θ 11 =( 1) 1+1 (8) = 8 A 11 = 6(1) 0(2) = 6 θ 12 =( 1) 1+2 (6) = 6 A 13 = 6(5) 8(2) = 14 θ 13 =( 1) 1+3 (14) = 14 Then the determinant of A is: A = n a 1j θ 1j = 10(8) + 5( 6) + 2(14) = 78 j=1 Note that we would have computed 78 regardless of which row and column we used. An important result in linear algebra states that if A = 0, then A is singular, otherwise A is nonsingular (full rank). The inverse of a square matrix A, denoted A 1, is a matrix such that A 1 I = AA 1 where I is the identity matrix of the same dimension as A. A unique inverse exists if A is square and full rank. The identity matrix, when multiplied by any matrix (such that matrix multiplication exists) returns the same matrix. That is: AI = A and I A, as long as the dimensions of the matrices conform to matrix multiplication. For a scalar (a 1 1 matrix): A 1 =1/A. Fora2 2 matrix: A 1 = 1 a22 a 12 A a 21 a 11 For n n matrices (n >2):. 1. Replace each element with its cofactor (θ rs ) 2. Transpose the resulting matrix 3. Divide each element by the determinant of the original matrix Example Inverse of a 3 3 matrix We compute the inverse of a 3 3 matrix (the same matrix as before). 10 5 2 6 8 0 A =78 2 5 1 A 11 =8 A 12 =6 A 13 =14

A 21 = 5 A 22 =6 A 23 =40 A 31 = 16 A 32 = 12 A 33 =50 θ 11 =8 θ 12 = 6 θ 13 =14 θ 21 =5 θ 22 =6 θ 23 = 40 θ 31 = 16 θ 32 =12 θ 33 =50 A 1 = 1 78 8 5 16 6 6 12 14 40 50 As a check: A 1 1 78 8 5 16 6 6 12 14 40 50 10 5 2 6 8 0 2 5 1 = 1 0 0 0 1 0 0 0 1 = I 3 To obtain the inverse of a diagonal matrix, simply compute the recipocal of each diagonal element. The following results are very useful for matrices A, B, C and scalar λ, as long as the matrices dimensions are conformable to the operations in use: 1. A + B = B + A 2. (A + B)+C = A +(B + C) 3. (AB)C = A(BC) 4. C(A + B) = CA + CB 5. λ(a + B) = λa + λb 6. (A ) = A 7. (A + B) = A + B 8. (AB) = B A 9. (ABC) = C B A 10. (AB) 1 = B 1 A 1 11. (ABC) 1 = C 1 B 1 A 1 12. (A 1 ) 1 = A 13. (A ) 1 = (A 1 ) The length of a column vector x and the distance between two column vectors u and v are: l(x) = x x l((u v)) = (u v) (u v) Vectors x and w are orthogonal if x w =0.

1.1 Linear Equations and Solutions Suppose we have a system of r linear equations in s unknown variables. We can write this in matrix notation as: Ax = y where x is a s 1 vector of s unknowns; A is a r s matrix of known coefficients of the s unknowns; and y is a r 1 vector of known constants on the right hand sides of the equations. This set of equations may have: No solution A unique solution An infinite number of solutions A set of linear equations is consistent if any linear dependencies among rows of A also appear in the rows of y. For example, the following system is inconsistent: 1 2 3 x 1 6 2 4 6 x 2 = 10 3 3 3 x 3 9 This is inconsistent because the coefficients in the second row of A are twice those in the first row, but the element in the second row of y is not twice the element in the first row. There will be no solution to this system of equations. A set of equations is consistent if r(a) = r(ay) where Ay is the augmented matrix A y. When r(a) equals the number of unknowns, and A is square: 1.2 Projection Matrices x = A 1 y The goal of regression is to transform a n-dimensional column vector Y onto a vector Ŷ in a subspace (such as a straight line in 2-dimensional space) such that Ŷ is as close to Y as possible. Linear transformation of Y to Ŷ, Ŷ = PY is said to be a projection iff P is idempotent and symmetric, in which case P is said to be a projection matrix. A square matrix A is idempotent if A A. IfA is idempotent, then: r(a) = n a ii = tr(a) i=1 where tr(a) is the trace of A. The subspace of a projection is defined, or spanned, by the columns or rows of the projection matrix P. Ŷ = PY is the vector in the subspace spanned by P that is closest to Y in distance. That is: SS(RESIDUAL) = (Y Ŷ) (Y Ŷ)

is at a minimum. Further: e = (I P)Y is a projection onto a subspace orthogonal to the subspace defined by P. Ŷ e =(PY) (I P)Y = Y P (I P)Y = Y P(I P)Y = Y (P P)Y =0 Ŷ + e = PY +(I P)Y = Y 1.3 Vector Differentiation Let f be a function of x =x 1,...,x p. We define: df dx = f x 1 f x 2. f x p From this, we get for p 1 vector a and p p symmetric matrix A: d(a x) dx = a d(x Ax) =2Ax dx Proof Consider p =3: a d(a x) x = a 1 x 1 + a 2 x 2 + a 3 x 3 = a i d(a x) = a dx i dx x Ax = x 1 a 11 + x 2 a 21 + x 3 a 31 x 1 a 12 + x 2 a 22 + x 3 a 32 x 1 a 13 + x 2 a 23 + x 3 a 33 x 1 x 2 x 3 = = x 2 1 a 11 + x 1 x 2 a 21 + x 1 x 3 a 31 + x 1 x 2 a 12 + x 2 2 a 22 + x 2 x 3 a 32 + x 1 x 3 a 13 + x 2 x 3 a 23 + x 2 3 a 33 x Ax x x Ax x i = x Ax x 1 x Ax x 2 x Ax x 3 =2a ii x i +2 j =i = a ij x j (a ij = a ji ) 2a 11x 1 +2a 12 x 2 +2a 13 x 3 2a 21 x 1 +2a 22 x 2 +2a 23 x 3 2a 31 x 1 +2a 32 x 2 +2a 33 x 3 =2Ax