Review from Bootcamp: Linear Algebra

Similar documents
MATRICES AND MATRIX OPERATIONS

Phys 201. Matrices and Determinants

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

M. Matrices and Linear Algebra

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

A Review of Matrix Analysis

Matrices and Determinants

Elementary Row Operations on Matrices

A primer on matrices

Mathematics. EC / EE / IN / ME / CE. for

Introduction to Matrices

Graphics (INFOGR), , Block IV, lecture 8 Deb Panja. Today: Matrices. Welcome

Matrices. Chapter Definitions and Notations

Matrices BUSINESS MATHEMATICS

Fundamentals of Engineering Analysis (650163)

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

Matrices and Vectors

Introduction to Matrix Algebra

ECON 186 Class Notes: Linear Algebra

MATH 2030: EIGENVALUES AND EIGENVECTORS

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

Basic Linear Algebra in MATLAB

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

Matrix & Linear Algebra

Things we can already do with matrices. Unit II - Matrix arithmetic. Defining the matrix product. Things that fail in matrix arithmetic

Notation, Matrices, and Matrix Mathematics

Elementary maths for GMT

Matrix Basic Concepts

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

Basic Concepts in Linear Algebra

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

Introduction to Determinants

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

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

POLI270 - Linear Algebra

Review of Basic Concepts in Linear Algebra

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

Determinants - Uniqueness and Properties

MATRICES The numbers or letters in any given matrix are called its entries or elements

Knowledge Discovery and Data Mining 1 (VO) ( )

1 Determinants. 1.1 Determinant

Lecture Notes in Linear Algebra

Linear Algebra Primer

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.

Matrices A brief introduction

MATH 320, WEEK 7: Matrices, Matrix Operations

Lecture 7: Vectors and Matrices II Introduction to Matrices (See Sections, 3.3, 3.6, 3.7 and 3.9 in Boas)

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 )

A primer on matrices

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

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

a11 a A = : a 21 a 22

The word Matrices is the plural of the word Matrix. A matrix is a rectangular arrangement (or array) of numbers called elements.

1 Matrices and Systems of Linear Equations. a 1n a 2n

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

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

18.02 Multivariable Calculus Fall 2007

Math 123, Week 2: Matrix Operations, Inverses

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

TOPIC III LINEAR ALGEBRA

1300 Linear Algebra and Vector Geometry

Prepared by: M. S. KumarSwamy, TGT(Maths) Page

Image Registration Lecture 2: Vectors and Matrices

Math 360 Linear Algebra Fall Class Notes. a a a a a a. a a a

Lecture 8: Determinants I

Matrices. 1 a a2 1 b b 2 1 c c π

Matrices. In this chapter: matrices, determinants. inverse matrix

Foundations of Matrix Analysis

3 (Maths) Linear Algebra

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

Chapter 7. Linear Algebra: Matrices, Vectors,

1 Matrices and matrix algebra

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

Math Camp Notes: Linear Algebra I

Section 12.4 Algebra of Matrices

Materials engineering Collage \\ Ceramic & construction materials department Numerical Analysis \\Third stage by \\ Dalya Hekmat

Topic 1: Matrix diagonalization

Arrays: Vectors and Matrices

Chapter 2:Determinants. Section 2.1: Determinants by cofactor expansion

Linear Equations and Matrix

Review of Linear Algebra

11 a 12 a 13 a 21 a 22 a b 12 b 13 b 21 b 22 b b 11 a 12 + b 12 a 13 + b 13 a 21 + b 21 a 22 + b 22 a 23 + b 23

Linear Systems and Matrices

MATHEMATICS. IMPORTANT FORMULAE AND CONCEPTS for. Final Revision CLASS XII CHAPTER WISE CONCEPTS, FORMULAS FOR QUICK REVISION.

The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices

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

CP3 REVISION LECTURES VECTORS AND MATRICES Lecture 1. Prof. N. Harnew University of Oxford TT 2013

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

We use the overhead arrow to denote a column vector, i.e., a number with a direction. For example, in three-space, we write

Linear Algebra, Vectors and Matrices

Mathematics for Graphics and Vision

MATH2210 Notebook 2 Spring 2018

Matrices and Determinants for Undergraduates. By Dr. Anju Gupta. Ms. Reena Yadav

Matrix representation of a linear map

Lecture 3 Linear Algebra Background

Review of Vectors and Matrices

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

MATH 106 LINEAR ALGEBRA LECTURE NOTES

Linear Algebra and Matrix Inversion

1111: Linear Algebra I

Transcription:

Review from Bootcamp: Linear Algebra D. Alex Hughes October 27, 2014

1 Properties of Estimators 2 Linear Algebra Addition and Subtraction Transpose Multiplication Cross Product Trace 3 Special Matrices Matrix Inversion Determinants D. Alex Hughes Linear Algebra Review October 27, 2014 2 / 46

Properties of Estimators 1 Unbiasedness: 2 Asymptotic Unbiasedness: E(ˆθ) θ = 0 lim P( E[ˆθ] θ > ɛ) 0; ɛ > 0 n 3 Efficiency 4 Consistency 1 MSE = 1 E[(ˆθ θ) 2 ] lim n P( ˆθ θ > ɛ) 0 ɛ > 0 D. Alex Hughes Linear Algebra Review October 27, 2014 3 / 46

Linear algebra Motivation: Linear algebra or matrix algebra avoids the mess and lets us solve for things we care about quickly, cleanly and easily. This is no different than algebra. Consider the difference in the following formulas for the mean: x = x 1 + x 2 n x = x 1 + x 2 + x 3 n x = x 1 + x 2 + x 3 + x 4 n xi x = n D. Alex Hughes Linear Algebra Review October 27, 2014 4 / 46

Linear algebra Similarly, matrix algebra is a form of notation that cleans up the mess when working with more complex formulas. So suspend disbelief and concern, and treat this as a new language you are learning. Think of this as algebra on steroids. D. Alex Hughes Linear Algebra Review October 27, 2014 5 / 46

Motivation Why are we studying matrix algebra? We will use matrix algebra to derive the least squares estimator Matrices are an intuitive way to think about data. We have a set of observations (perhaps individuals) on the row, and observe many different characteristics (such as race, gender, PID, etc.) corresponding to columns Matrices are useful for solving systems of equations, like multiple regression Notation is much more compact and concise D. Alex Hughes Linear Algebra Review October 27, 2014 6 / 46

Definition of Matrices and Vectors Definition A matrix is simply an arrangement of numbers in rectangular form. Generally, a (j k) matrix A can be written as follows: a 11 a 12 a 1k a 21 a 22 a 2k A =...... a j1 a j2 a jk Note that there are j rows and k columns, defining the dimensionality (order) of the matrix. Also note that the elements are double sub-scripted, with the row number first, and the column number second. In general terms, the A above is of order (j, k). D. Alex Hughes Linear Algebra Review October 27, 2014 7 / 46

Examples Example W = [ 1 3 2 6 is of order (2, 2). This is also called a square matrix. There are also rectangular matrices (j k), such as: ] Example which is of order (4,2). Γ = 1 4 1 3 1 2 0 3 D. Alex Hughes Linear Algebra Review October 27, 2014 8 / 46

Notation Matrices are usually written using capital, bold-faced Roman or Greek letters. Roman is typically data, and Greek is typically parameters. This is not universal. D. Alex Hughes Linear Algebra Review October 27, 2014 9 / 46

Vector Definition Vectors are matrices that have either one row or one column. is the same as a scalar a regular number. Row vectors have a single row and multiple columns. α = [ ] α 1 α 2 α 3 α k Column vectors are those that have a single column and multiple rows. y 1 y 2 y =. y k D. Alex Hughes Linear Algebra Review October 27, 2014 10 / 46

Operations on Matrices Addition and Subtraction Scalar addition is simply: m + n = 2 + 5 = 7 Addition is similarly defined for matrices. If matrices or vectors are of the same order, then they can be added. One performs the addition element by element. D. Alex Hughes Linear Algebra Review October 27, 2014 11 / 46

Addition A + B = C: [ a11 a 12 a 21 a 22 ] [ b11 b + 12 b 21 b 22 ] [ a11 + b = 11 a 12 + b 12 a 21 + b 21 a 22 + b 22 ] [ c11 c = 12 c 21 c 22 ] D. Alex Hughes Linear Algebra Review October 27, 2014 12 / 46

Subtraction A B = D: [ 1 4 2 5 3 3 ] [ 3 2 8 2 2 3 ] = [ 4 2 10 3 5 6 ] D. Alex Hughes Linear Algebra Review October 27, 2014 13 / 46

Properties of Matrix Addition A + B = B + A. Matrix addition is commutative. (A + B) + C = A + (B + C). Matrix addition is associative. D. Alex Hughes Linear Algebra Review October 27, 2014 14 / 46

Transpose Definition To transpose a matrix is to exchange order subscripts. An order (j, k) matrix becomes an order (k, j) matrix. Transposition is denoted by placing a prime after a matrix or by placing a superscript T. Q = q 1,1 q 1,2 q 2,1 q 2,2 q 3,1 q 3,2 [ ] Q q1,1 q = 2,1 q 3,1 q 1,2 q 2,2 q 3,2 Note that the subscripts in the transpose remain the same, they are just exchanged. D. Alex Hughes Linear Algebra Review October 27, 2014 15 / 46

Example Example ω = 1 3 2 5 ω = [ 1 3 2 5 ] D. Alex Hughes Linear Algebra Review October 27, 2014 16 / 46

Some Definitions There are a few results regarding transposition that are important to remember: An order (j, j) matrix A is said to be symmetric iff A = A. (A ) = A W = 1.2.5.2 1.4.5.4 1 For a scalar k, (ka) = ka. W = 1.2.5.2 1.4.5.4 1 For two matrices of the same order, the transpose of the sum is equal to the sum of the transposes. (A + B) = A + B D. Alex Hughes Linear Algebra Review October 27, 2014 17 / 46

Matrices and Multiplication Scalar times a matrix. In words, a scalar α times a matrix A equals the scalar times each element of A. Thus, [ ] [ ] a1,1 a αa = α 1,2 αa1,1 αa = 1,2 a 2,1 a 2,2 αa 2,1 αa 2,2 So, for: A = [ 4 8 2 6 8 10 ] [ 1 2 4 1 2 A = 3 4 5 ] D. Alex Hughes Linear Algebra Review October 27, 2014 18 / 46

Matrices and Multiplication Definition Given A of order (m, n) and B of order (n, r), then the product AB = C is the order (m, r) matrix whose entries are defined by: c i,j = n a i,k b k,j k=1 where i = 1,..., m and j = 1,..., r and k 1 = n 2 D. Alex Hughes Linear Algebra Review October 27, 2014 19 / 46

Matrices and Multiplication A = [ 2 1 3 4 1 6 ] B = 3 2 2 4 1 3 AB = = [ 2 3 + 1 2 + 3 1 2 ( 2) + 1 4 + 3 ( 3) 4 3 + 1 2 + 6 1 4 ( 2) + 1 4 + 6 ( 3) [ ] 1 1 20 22 ] D. Alex Hughes Linear Algebra Review October 27, 2014 20 / 46

Matrices and Multiplication Is multiplication of matrices commutative? A = [ 2 1 3 4 1 6 ] B = 3 2 2 4 1 3 D. Alex Hughes Linear Algebra Review October 27, 2014 21 / 46

Matrices and Multiplication BA = 14 1 3 12 6 30 14 2 15 No: Multiplication of matrices is not commutative. In other words: AB BA. D. Alex Hughes Linear Algebra Review October 27, 2014 22 / 46

Matrices and Multiplication Important results Matrix multiplication is not commutative: AB BA. Matrix multiplication is associative: (AB)C = A(BC) Matrix multiplication is distributive: A(B + C) = AB + AC The transpose of a product can be written as (AB) = B A D. Alex Hughes Linear Algebra Review October 27, 2014 23 / 46

Vectors and Multiplication Inner product of vectors e e = [ ] e 1 e 2 e N e 1 e 2. e N Alt: outer product e e = e 1 e 1 + e 2 e 2 + + e N e N = N i=1 e 2 i D. Alex Hughes Linear Algebra Review October 27, 2014 24 / 46

Other Useful Vector Products Let i denote an order (N, 1) vector of ones, and x denote an order (N, 1) vector of data. i x = (x 1 + x 2 + x N ) = x i From this, it follows that: 1 N i x = 1 xi = x N D. Alex Hughes Linear Algebra Review October 27, 2014 25 / 46

Cross Product A B = ˆn A B cos(θ) ˆn: perpendicular unit vector A : Length of A θ: angle between A & B D. Alex Hughes Linear Algebra Review October 27, 2014 26 / 46

Trace Sum of the diagonal elements of a square matrix. A = a 11 a 12 a 1n a 21 a 22 a 2n...... a n1 a n2 a nn tr(a) = a ii = a 11 + a 22 + + a nn D. Alex Hughes Linear Algebra Review October 27, 2014 27 / 46

Special Matrices and Their Properties When performing scalar algebra, we know that x 1 = x, which is known as the identity relationship. There is a similar relationship in matrix algebra: AI = A. What is I? It can be shown that I is a diagonal, square matrix with ones on the main diagonal, and zeros on the off diagonal. For example, the order three identity matrix is: I 3 = 1 0 0 0 1 0 0 0 1 D. Alex Hughes Linear Algebra Review October 27, 2014 28 / 46

Special Matrices and Their Properties Notice that I is oftentimes subscripted to denote its dimensionality. Here is an example of the use of an identity matrix: [ ] [ ] [ ] 1 2 1 0 1 2 = 3 4 0 1 3 4 D. Alex Hughes Linear Algebra Review October 27, 2014 29 / 46

Special Matrices and Their Properties One of the nice properties of the identity matrix is that it is commutative with respect to multiplication. That is, AIB = IAB = ABI = AB An identity in scalar algebra is x + 0 = x. This generalizes to matrix algebra, with the definition of the null matrix, which is simply a matrix of zeros, denoted 0 j,k. Here is an example: A + 0 2,2 = [ 1 2 3 4 ] [ 0 0 + 0 0 ] = [ 1 2 3 4 ] = A D. Alex Hughes Linear Algebra Review October 27, 2014 30 / 46

Matrix Inversion Definition: ZZ 1 = I This is roughly akin to division in non-matrix algebra. Actually calculating the inverse of a matrix takes several steps and has several prerequisites. D. Alex Hughes Linear Algebra Review October 27, 2014 31 / 46

Matrix Inversion General solution for a square matrix A: A 1 = 1 A adja So we need to figure out 1 A and adj(a). D. Alex Hughes Linear Algebra Review October 27, 2014 32 / 46

Matrix Inversion The first of these, A, is called the determinant. There s lots to learn about determinants, but we ll stick to the basics. Most importantly, if the determinant is NOT zero, a square matrix is invertible. The determinant is a scalar, that is, a single number, like 5. For a two by two matrix, the determinant is: [ ] a11 a A = 12 = a a 21 a 11 a 22 a 21 a 12 22 So you multiply the corners and subtract one product from the other. D. Alex Hughes Linear Algebra Review October 27, 2014 33 / 46

Graphical Intuition for Determinant of a 2x2 Matrix D. Alex Hughes Linear Algebra Review October 27, 2014 34 / 46

D. Alex Hughes Linear Algebra Review October 27, 2014 35 / 46

D. Alex Hughes Linear Algebra Review October 27, 2014 36 / 46

Graphical Linear Algebra For a 2x2 matrix, the determinant is two times the area of the triangle defined by the row vectors. Think about this for a matrix like: [ ] 1 2 A = 1 2 Or... A = [ 1 2 5 10 Most linear algebra functions can be represented graphically. Ask me for citations if you want a book that illustrates all these. ] D. Alex Hughes Linear Algebra Review October 27, 2014 37 / 46

Calculating Determinants With three by three matrices, the determinant is still quite manageable: a 11 a 12 a 13 A = a 21 a 22 a 23 a 31 a 32 a 33 = a 11 a 22 a 33 + a 12 a 23 a 31 + a 13 a 21 a 32 a 11 a 23 a 32 a 12 a 21 a 33 a 13 a 22 a 31 Graphically, this means adding the diagonal products from left to right, and subtracting the diagonal products from right to left. (example) D. Alex Hughes Linear Algebra Review October 27, 2014 38 / 46

More Determinants For bigger matrices, we have to use alternative methods, typically the Laplace Expansion. Basically, we break the matrix into sub-matricies, and calculate determinants of these submatricies, then combine our results. Steps: 1 Pick a row or column to work with. 2 For each element in that row, calculate the subdeterminant, also called the minor. 3 Multiply each element by its subdeterminant, determine signs, and add. D. Alex Hughes Linear Algebra Review October 27, 2014 39 / 46

Higher Order Determinants - Example 5 6 1 2 3 0 7 3 0 = 5 3 0 3 0 6 2 0 7 0 + 1 2 3 7 3 D. Alex Hughes Linear Algebra Review October 27, 2014 40 / 46

Properties of Determinants A = A Interchanging any two rows or columns will alter sign but not value of determinant. Multiplication of one row by k will change A to k A. Addition/subtraction of a multiple of any row to another row will leave the value of the determ unaltered (works for col too). If one row or columns is a multiple of another, the value of the determinant will be zero - matrix is singular D. Alex Hughes Linear Algebra Review October 27, 2014 41 / 46

Tricks for Determinants Pick a good row or column. 5 6 1 2 3 0 3 3 0 = 5 3 0 3 0 6 2 0 7 0 + 1 2 3 7 3 5 6 1 2 3 0 7 3 0 = 1 2 3 7 3 0 5 6 7 3 + 0 5 6 2 3 D. Alex Hughes Linear Algebra Review October 27, 2014 42 / 46

Tricks for Determinants Manipulate rows if possible 5 6 1 2 4 7 3 6 11 = 5 6 10 1 2 4 4 7 3 6 6 11 = 5 4 1 2 0 7 3 0 11 D. Alex Hughes Linear Algebra Review October 27, 2014 43 / 46

Back to inverting a matrix A 1 = 1 A adj(a) (adj means adjugate) where C 11 C 12 C 1n C 21 C 22 C 2n adj(a) =...... C n1 C n2 C nn D. Alex Hughes Linear Algebra Review October 27, 2014 44 / 46

Cofactors C ij is a matrix cofactor - the determinant of the matrix when excluding row i and column j, and adj(a) is the transpose of the matrix of cofactors. The determinant of the cofactor submatrix is multiplied by 1 when i + j is even, and by -1 when i + j is odd. D. Alex Hughes Linear Algebra Review October 27, 2014 45 / 46

Easy Inversion - 2X2 A 1 = 1 A adj(a) [ ] 1 2 X = 1 3 X 1 = 1 [ 3 2 3 2 1 1 ] D. Alex Hughes Linear Algebra Review October 27, 2014 46 / 46