1565 matrix01-ppt

30
Matrix Algebra Basics Pam Perlich Urban Planning 5/6020

Upload: dr-fereidoun-dejahang

Post on 14-Feb-2017

25 views

Category:

Education


0 download

TRANSCRIPT

Page 1: 1565 matrix01-ppt

Matrix Algebra Basics

Pam PerlichUrban Planning 5/6020

Page 2: 1565 matrix01-ppt

Algebra

Page 3: 1565 matrix01-ppt

Matrix

A

a11 ,, a1n

a21 ,, a2n

am1 ,, amn

Aij

A matrix is any doubly subscripted array of elements arranged in rows and columns.

Page 4: 1565 matrix01-ppt

Row Vector

[1 x n] matrix

 

jn aaaaA ,, 2 1

Page 5: 1565 matrix01-ppt

Column Vector

i

m

a

a

aa

A 2

1

[m x 1] matrix

Page 6: 1565 matrix01-ppt

Square Matrix

B 5 4 73 6 12 1 3

Same number of rows and columns

Page 7: 1565 matrix01-ppt

The Identity

Page 8: 1565 matrix01-ppt

Identity Matrix

I

1 0 0 00 1 0 00 0 1 00 0 0 1

Square matrix with ones on the diagonal and zeros elsewhere.

Page 9: 1565 matrix01-ppt

Transpose Matrix

A'

a11 a21 ,, am1

a12 a22 ,, am 2

a1n a2n ,, amn

Rows become columns and columns become rows

Page 10: 1565 matrix01-ppt

Matrix Addition and Subtraction

A new matrix C may be defined as the additive combination of matrices A and B where: C = A + B is defined by: 

Cij Aij Bij

Note: all three matrices are of the same dimension

Page 11: 1565 matrix01-ppt

Addition

A a11 a12

a21 a22

B b11 b12

b21 b22

C a11 b11 a12 b12

a21 b21 a 22 b22

If

and

then

Page 12: 1565 matrix01-ppt

Matrix Addition Example

A B 3 45 6

1 23 4

4 68 10

C

Page 13: 1565 matrix01-ppt

Matrix Subtraction

C = A - BIs defined by

Cij Aij Bij

Page 14: 1565 matrix01-ppt

Matrix Multiplication

Matrices A and B have these dimensions:

[r x c] and [s x d]

Page 15: 1565 matrix01-ppt

Matrix Multiplication

Matrices A and B can be multiplied if:

[r x c] and [s x d]

c = s

Page 16: 1565 matrix01-ppt

Matrix Multiplication

The resulting matrix will have the dimensions:

[r x c] and [s x d]

r x d

Page 17: 1565 matrix01-ppt

Computation: A x B = C

A a11 a12

a21 a22

B b11 b12 b13

b21 b22 b23

232213212222122121221121

2312131122121211 21121111

babababababababababababa

C

[2 x 2]

[2 x 3]

[2 x 3]

Page 18: 1565 matrix01-ppt

Computation: A x B = C

A 2 31 11 0

and B

1 1 1 1 0 2

[3 x 2] [2 x 3]A and B can be multiplied

1 1 13 1 28 2 5

12*01*1 10*01*1 11*01*1

32*11*1 10*11*1 21*11*182*31*2 20*31*2 51*31*2

C

[3 x 3]

Page 19: 1565 matrix01-ppt

Computation: A x B = C

1 1 13 1 28 2 5

12*01*1 10*01*1 11*01*1

32*11*1 10*11*1 21*11*182*31*2 20*31*2 51*31*2

C

A 2 31 11 0

and B

1 1 1 1 0 2

[3 x 2] [2 x 3]

[3 x 3]

Result is 3 x 3

Page 20: 1565 matrix01-ppt

Inversion

Page 21: 1565 matrix01-ppt

Matrix Inversion

B 1B BB 1 I

Like a reciprocal in scalar math

Like the number one in scalar math

Page 22: 1565 matrix01-ppt

Linear System of Simultaneous Equations

1st Precinct : x1 x2 62nd Pr ecinct : 2x1 x2 9

First precinct: 6 arrests last week equally divided between felonies and misdemeanors.

Second precinct: 9 arrests - there were twice as many felonies as the first precinct.

Page 23: 1565 matrix01-ppt

Solution

96

*1 21 1

2

1

xx

33

2

1

xx

1 21 1

Note: Inverse of is

1 21 1

96

*1 21 1

*1 21 1

* 1 21 1

2

1

xx Premultiply both sides by

inverse matrix

33

* 1 00 1

2

1

xx A square matrix multiplied by its

inverse results in the identity matrix.

A 2x2 identity matrix multiplied by the 2x1 matrix results in the original 2x1 matrix.

Page 24: 1565 matrix01-ppt

aijxj bi or Ax bj1

n

x A 1Ax A 1b

n equations in n variables:

unknown values of x can be found using the inverse of matrix A such that

General Form

Page 25: 1565 matrix01-ppt

Garin-Lowry Model

Ax y x

y Ix Axy (I A)x

(I A) 1 y x

The object is to find x given A and y . This is done by solving for x :

Page 26: 1565 matrix01-ppt

Matrix Operations in Excel

Select the cells in which the answer will appear

Page 27: 1565 matrix01-ppt

Matrix Multiplication in Excel

1) Enter “=mmult(“

2) Select the cells of the first matrix

3) Enter comma “,”

4) Select the cells of the second matrix

5) Enter “)”

Page 28: 1565 matrix01-ppt

Matrix Multiplication in Excel

Enter these three key strokes at the same time:

control

shift

enter

Page 29: 1565 matrix01-ppt

Matrix Inversion in Excel Follow the same procedure Select cells in which answer is to be

displayed Enter the formula: =minverse( Select the cells containing the matrix to be

inverted Close parenthesis – type “)” Press three keys: Control, shift, enter

Page 30: 1565 matrix01-ppt