0% found this document useful (0 votes)
165 views

331 Notes Matrix

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views

331 Notes Matrix

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

ECON 331 Lecture Notes: Ch 4 and Ch 5

1 Matrix Algebra
1. Gives us a shorthand way of writing a large system of equations.
2. Allows us to test for the existance of solutions to simultaneous systems.
3. Allows us to solve a simultaneous system.
DRAWBACK: Only works for linear systems. However, we can often covert non-linear to linear systems.
Example
y = axb
ln y = ln a + b ln x
Matrices and Vectors
Given
y = 10 − x ⇒ x + y = 10
y = 2 + 3x ⇒ −3x + y = 2
In matrix form   
1 1 x = 10
−3 1 y 2
Matrix of Coefficients Vector of Unknows Vector of Constants
In general
a11 x1 + a12x2 + . . . + a1nxn = d1
a21 x1 + a22x2 + . . . + a2nxn = d2
..............................
am1 x1 + am2x2 + . . . + amnxn = dm
n-unknowns (x1, x2, . . . xn)
Matrix form     
a11 a12 . . . a1n x1 d1

 a21 a22 . . . a2n 
 x2  
  d2 

 .. ... ..  .. = .. 
 . ... .  .   . 
am1 am2 . . . amn xn dm
Matrix shorthand
Ax = d
Where:
A= coefficient martrix or an array
x= vector of unknowns or an array
d= vector of constants or an array
Subscript notation
aij
is the coefficient found in the i-th row (i=1,. . . ,m) and the j-th column (j=1,. . . ,n)

1
1.1 Vectors as special matrices

The number of rows and the number of columns define the DIMENSION of a matrix.
A is m rows and n is columns or ”mxn.”
A matrix containing 1 column is called a ”column VECTOR”
x is a n×1 column vector
d is a m×1 column vector
If x were arranged in a horizontal array we would have a row vector.
Row vectors are denoted by a prime
x = [x1 , x2, . . . , xn]
A 1×1 vector is known as a scalar.
x = [4] is a scalar
Matrix Operators
If we have two matrices, A and B, then
A = B iff aij = bij
Addition and Subtraction of Matrices Suppose A is an m×n matrix and B is a p×q matrix then A
and B is possible only if m=p and n=q. Matrices must have the same dimensions.
   
a11 a12 b11 b12 (a11 + b11 ) (a12 + b12) c11 c12
a21 a22 + b21 b22 = (a21 + b21 ) (a22 + b22) = c21 c22
Subtraction is identical to addition
9 4 − 7 2 = (9 − 7) (4 − 2) = 2 2
   
3 1 1 6 (3 − 1) (1 − 6) 2 −5
Scalar Multiplication Suppose we want to multiply a matrix by a scalar
k × A
1×1 m×n
We multiply every element in A by the scalar k
 
ka11 ka12 . . . ka1n
 ka21 ka22 . . . ka2n 
kA =  .. 

. 
kam1 kam2 . . . kamn
Example 
Let k=[3] and A= 64 25
then kA=
× 6 3 × 2 = 18 6
kA = 33 ×
 
4 3×5 12 15
Multiplication of Matrices To multiply two matrices, A and B, together it must be true that for
A × B = C
m×n n×q m×q
That A must have the same number of columns (n) as B has rows (n).
The product matrix, C, will have the same number of rows as A and the same number of columns as B.

2
Example
A × B = C
(1 × 3) (3 × 4) (1 × 4)
1row 3rows 1row
3cols 4cols 4cols
In general
A × B × C × D = E
(3 × 2) (2 × 5) (5 × 4) (4 × 1) (3 × 1)
To multiply two matrices:
(1) Multiply each element in a given row by each element in a given column
(2) Sum up their products
Example 1   
a11 a12 × b11 b12 = c11 c12
a21 a22 b21 b22 c21 c22
Where:
c11=a11 b11 + a12b21 (sum of row 1 times column 1)
c12=a11 b12 + a12b22 (sum of row 1 times column 2)
c21=a21 b11 + a22b21 (sum of row 2 times column 1)
c22=a21 b12 + a22b22 (sum of row 2 times column 2)
Example 2

1 2

3 2 3 4 =

(3 × 1) +(2 × 3) (3 × 2) +(2 × 4)

= 9 14

Example 3  
2
3 2 1  1  = (3 × 2) + (2 × 1) + (1 × 4) = [12]
 
4
12 is the inner product of two vectors.
Suppose 
x = xx1

then x = x1 x2
2

therefore 
x x = x1 x2
 x1
x2

= x21 + x22
However
xx = 2 by 2 matrix
 
x1 
x1 x2 = xxx1 xx1x2 2
2

x2 2 1 2

Example 4  
1 3
A= 2 8
4 0

b= 5
9
(1 × 5) + (3 × 9)
   
32
Ab =  (2 × 5) + (8 × 9) = 82 
(4 × 5) + (0 × 9) 20

3
Example
Ax = d

 A   x  d 
6 3 1 x1 22
 1 4 −2   x2  =  12 
4 −1 5 x3 10
(3 × 3) (3 × 1) (3 × 1)
This produces
6x1 + 3x2 + x3 = 22
x1 + 4x2 − 2x3 = 12
4x1 − x2 + 5x3 = 10
1.1.1 National Income Model
y = c + I0 + G 0
C = a + bY
Arrange as
y − C = I0 + G0
−bY + C = a
Matrix form
A x =d
1 −1  Y

I
= o +a Go

−b 1 C
1.1.2 Division in Matrix Algebra
In ordinary algebra
a =c
b
is well defined iff b= 0.
Now 1b can be rewritten as b 1 , therefore ab 1 = c, also b 1a = c.
− − −

But in matrix algebra


A
B =C
is not defined. However,
AB 1 = C−

is well defined. BUT


AB 1 = B 1 A
− −

B 1 is called the inverse of B


B 1 = B1

In some ways B −1
has the same properties as b −1
but in other ways it differs. We will explore these
differences later.

4
1.2 Linear Dependance

Suppose we have two equations


x1 + 2x2 = 1
3x1 + 6x2 = 3
To solve
3 [−2x2 + 1] − 6x2 = 3
6x2 + 3 − 6x2 = 3
3=3
There is no solution. These two equations are linearly dependent. Equation 2 is equal to two times
equation one.   
1 2 x1 = 1
3 6 x 3 2

Ax = d
where A is a two column vectors   
U1 U2
 1  2 
3 6
Or A is two row vector
V1 = [1 2]
V2 = [3 6]
Where column two is twice column one and/or row two is three times row one
2U1 = U2 or 3V1 = V2
Linear Dependence Generally:
A set of vectors is said to be linearly dependent iff any one of them can be expressed as a linear combination
of the remaining vectors.
Example:
Three vectors,   
V1 = 27 V2 = 18 V3 = 45
are linearly dependent since
3V1 −2V2 = V3  
6 2 4
21 − 16 = 5
or expressed as
3V1 − 2V2 − V3 = 0
General Rule
A set of vectors, V1, V2,..., Vn are linearly dependent if there exsists a set of scalars (i=1,. . . ,n). Not all
equal to zero, such that
n

= ki Vi = 0
i=1
Note n

kiVi = k1V1 + k2V2 + . . . + knVn


i=1

5
1.3 Commutative, Associative, and Distributive Laws

From Highschool algebra we know commutative law of addition,


a+b=b+a
commutative law of multiplication,
ab = ba
Associative law of addition,
(a + b) + c = a + (b + c)
associative law of multiplication,
(ab)c = a(bc)
Distributive law
a(b + c) = ab + ac
In matrix algebra most, but not all, of these laws are true.

1.3.1 Communicative Law of Addition


A+B =B+A
Since we are adding individual elements and aij + bij = bij + aij for all i and j.

1.3.2 Similarly Associative Law of Addition


A + (B + C ) = (A + B ) + C
for the same reasons.

1.3.3 Matrix Multiplication


Matrix multiplication in not communtative
AB = BA
Example 1
Let A be 2×3 and B be 3×2
A × B = C whereas B × A = C
(2 × 3) (3 × 2) (2 × 2) (3 × 2) (2 × 3) (3 × 3)
Example 2
Let A= 13 24 and B= 06 −71
 

AB = (1(3××10) + (2 × 6) (1 × −1) + (2 × 7)
 
12 13
0) + (4 × 6) (3 × −1) + (4 × 7) = 24 25
But
BA = (0)(1) − (1)(3) (0)(2) − (1)(4) 
−3 −4 
(6)(1) + (7)(3) (6)(2) + (7)(4) = 27 40
Therefore, we realize the distinction of post multiply and pre multiply. In the case
AB = C
B is pre multiplied by A, A is post multiplied by B.

6
1.3.4 Associative Law
Matrix multiplication is associative
(AB)C = A(BC ) = ABC
as long as their dimensions conform to our earlier rules of multiplication.
A × B × C
(m × n ) (n × p) (p × q)
1.3.5 Distributive Law
Matrix multiplication is distributive
A(B + C ) = AB + AC Pre multiplication
(B + C )A = BA + CA Post multiplication
1.4 Identity Matrices and Null Matrices

1.4.1 Identity matrix:


is a square matrix with ones on its principal diagonals and zeros everywhere else.
 
  1 0 ... n
 1 0 0  .. 
I2 = 10 01 0 1 .
 
I3 =  0 1 0  In = 
 .. .


0 0 1  . . . 0 
0 ... 0 1
Identity Matrix in scalar algebra we know
1×a=a×1=a
In matrix algebra the identity matrix plays the same role
IA = AI = A
Example 1 
Let A= 12 34

1 3 = (1 × 1) + (0 × 2) (1 × 3) + (0 × 4) = 1 3
   
IA = 10 01 2 4 (0 × 1) + (1 × 2) (0 × 3) + (1 × 4) 2 4

Example 2 
Let A= 12 20 33
  
IA = 10 01 1 2 3 = 1 2 3 = A {I Case}
2 0 3 2 0 3 2

 
 1 0 0 
AI = 12 20 33  0 1 0 = 1 2 3 = A {I Case}
2 0 3 3
0 0 1
Furthermore,
AIB = (AI )B = A(IB) = AB
(m × n)(n × p) (m × n)(n × p)

7
1.4.2 Null Matrices
A null matrix is simply a matrix where all elements equal zero.
 
0 = 00 00 0 = 00 00 00
(2 × 2) (2 × 3)
The rules of scalar algebra apply to matrix algebra in this case.
Example
a + 0 = a ⇒ {scalar}
 
A + 0 = aa11 aa12 + 00 00 = A {matrix}
21 22
 
0  
A × 0 = aa11 aa12 aa13 =  0  = 00 = 0
21 22 23
0
1.5 Idiosyncracies of matrix algebra
1) We know AB=BA
2)ab=0 implies a or b=0
In matrix
AB = 21 42

−24 0 0
 
1 −2 = 0 0
1.5.1 Transposes and Inverses
1)Transpose: is when the rows and columns are interchanged.
Transpose of A=A’or AT
Example
If A= 31 80 −49 and B= 31 47
 

 
3 1 
A’= 8 0  and B’= 31 47
−9 4
Symmetrix Matrix
   
1 0 4 1 0 4
If A= 0 3 7  then A’= 0 3 7 
4 7 2 4 7 2
A is a symmetric matrix.

Properties of Transposes 1) (A’)’=A


2) (A+B)’=A’+B’
3) (AB)’=B’A’
Inverses and their Properties
In scalar algebra if
ax = b

8
then
x = ab or ba −1

In matrix algebra
if
Ax = d
then
x = A 1d −

where A 1 is the inverse of A.


Properties of Inverses 1) Not all matrices have inverses


non-singular: if there is an inverse
singular: if there is no inverse
2) A matrix must be square in order to have an inverse. (Necessary but not sifficient)
3) In scalar algebra aa = 1, in matrix algebra AA 1 = A 1A = I − −

4) If an inverse exists then it must be unique.


Example
3 1
 1
Let A= 0 2 and A 1 = 03 −

1
1
6


2 −1 by factoring 1 is a scalar

A =
−1 1
0 3
6 6

Post Multiplication
2 −1 1 = 6 0 1 = 1 0
   
AA 1 = 30 12

0 3 6 0 6 6 0 1
Pre Multiplication
A A = 16 02 −31 30 12 = 16 60 06 = 10 01
   
−1

Further properties If A and B are square and non-singular then:


1) (A 1 ) 1 = A
− −

2) (AB) 1 = B 1 A 1
− − −

3) (A’) 1 = (A 1)1
− −

Solving a linear system


Suppose
A x = d
(3 × 3) (3 × 1) (3 × 1)
then
A −1
A x = A −1
d
(3 × 3) (3 × 3) (3 × 1) (3 × 3) (3 × 1)
I x = A −1
d
(3 × 3) (3 × 1) (3 × 3) (3 × 1)
x = A 1d −

Example
Ax = d

9
1  −1813 −2616 −1310
       
6 3 1 x1 22
A= 1 4 −2  x =  x2  d= 12  A 1 = 52
− 
4 −1 5 x3 10 −17 18 21
then
18 −16 −10
      
x1 1 22 2
 x2 = −13 26 13  12 = 3 
x3 52 −17 18 21 10 1
x1 = 2 x2 = 3 x3 = 1
∗ ∗ ∗

2 Linear Dependence and Determinants

Suppose we have the following


1. x1 + 2x2 = 1
2. 2x1 + 4x2 = 2
where equation two is twice equation one. Therefore, there is no solution for x1, x2 .
In matrix form:
Ax = d
A  x  d 
1 2 x1 = 1
2 4 x2 2
The determinant of the coefficient matrix is
|A| = (1)(4) − (2)(2) = 0
a determinant of zero tells us that the equations are linearly dependent. Sometimes called a ”vanishing
determinant.”
In general, the determinant of a square matrix, A is written as |A| or detA.
For two by two case
|A | = a11 a12 = a a − a a = k
a21 a22 11 22 12 21

where k is unique
any k= 0 implies linear independence
Example 1 
A= 31 25
|A| = (3 × 5) − (1 × 2) = 13 {Non-singular}
Example 2 
B= 28 246
|B| = (2 × 24) − (6 × 8) = 0 {Singular}
Three by three case

10
 
a1 a2 a3
Given A= b1 b2 b3 
c1 c2 c3
then
|A| = (a b c ) + (a b c ) + (b c a ) − (a b c ) − (a b c ) − (b c a )
1 2 3 2 3 1 1 2 3 3 2 1 2 1 3 3 2 1

Cross-diagonals  
a1 a2 a3
 b1 b2 b3 
c1 c2 c3
Use viso to display cross diagonals
Multiple along the diagonals and add up their products
⇒The product along the BLUE lines are given a positive sign
⇒The product of the RED lines are negative.
2.1 Using Laplace expansion
⇒ The cross diagonal method does not work for matrices greater than three by three
⇒ Laplace expansion evaluates the determinant of a matrix, A, by means of subdeterminants of A.
Subdeterminants
 or Minors

a1 a2 a3
Given A= b1 b2 b3 
c1 c2 c3
By deleting the first row and first column, we get

|M11| = cb22 cb33
The determinant of this matrix is the minor element a1 .
|Mij | ≡ is the subdeterminant from deleting the i-th row and the j-th column.
 
a1 a2 a3
Given A= b1 b2 b3 
c1 c2 c3
then  
M21 ≡ aa12 aa13 M31≡
a12 a13
a22 a23
32 33

2.1.1 Cofactors
A cofactor is a minor with a specific algebraic sign.
Cij = (−1)i+j |Mij |
therefore
C11 = (−1)2 |M11 | = |M11|

C21 = (−1)3 |M21| = −|M21 |


The determinant by Laplace
Expanding down the first column  
a11 a12 a13
A =  a21 a22 a23 
a31 a32 a33

11
|A| = a |C | + a |C | + a |C | =
ai |Ci |
3

11 11 21 21 31 31 1 1
i=1
     
|A| 
= a11  a22 a23 
− 
a21  a12 a13   a12 a13 
a32 a33  + a31  a22 a23
  
a32 a33  

Note: minus sign (-1)(1+2)


|A| = a[a22 a33 − a23 a32 ] − a21 [a12 a33 − a13 a32] + a31 [a12 a23 − a13 a22]
11

Laplace expansion can be used to expand along any row or any column.
Example
Third row      
|A| = a 
 a12 a13 
 −a 
 a11 a13  + a  a11 a12 

31 
a22 a23  32 
a21 a23  33  a21 a22 
Example
 
8 1 3
A= 4 0 1 
6 0 3
(1)Expand the first column
     
|A | 
= 8  0 1 
 − 
4  1 3  + 6  1 3 

0 3  0 3 0 1 

|A| = (8 × 0) − (4 × 3) + (6 × 1) = −6
(2)Expand the second column
     
|A| = − 
1  4 1  + 0  8 3 
 − 
0  8 3 

6 3 6 3  4 1 

|A| = (−1 × 6) + (0) − (0) = −6


Suggestion: Try to choose an easy row or column to expand. (i.e. the ones with zero’s in it.)

2.2 Rank of a Matrix

Definition
The rank of a matrix is the maximum number linearly independent rows in the matrix.
If A is an m×n matrix, then the rank of A is
r(A) ≤ min [m, n]
Read as: the rank of A is less than or equal to the minimum of m or n.
Using Determinants to Find the Rank
(1) If A is n×m and |A|=0
(2) Then delete one row and one column, and find the determinant of this new (n-1)×(n-1) matrix.
(3) Continue this process until you have a non-zero determinant.

12
3 Matrix Inversion
Given an n×n matrix, A, the inverse of A is
A 1 = |A1 | • AdjA

where AdjA is the adjoint matrix of A. AdjA is the transpose of matrix A’s cofactor matrix. It is also
the adjoint, which is an n×n matrix
Cofactor Matrix (denoted C)
The cofactor matrix of A is a matrix who’s elements are the cofactors of the elements of A
If A = aa11 aa12

then C = | C | |C |  = a − a 
| C | |C | −a a
11 12 22 21
21 22 21 22 12 11

Example 
3 2
Let A= 1 0 ⇒ |A|=-2
Step 1: Find the cofactor matrix
C= |C | |C |  = 0 − 1 
|C | |C | −2 3
11 12
21 22

Step 2: Transpose the cofactor matrix


0 −2

C T = AdjA = −1 3
Step 3: Multiply all the elements of AdjA by A1 to find A 1
| |

A 1 = |A1 | • AdjA = − 12 −01 −32 = 01 −13


   

2 2

Step 4: Check by AA = I
−1

0 1 = (3)(0) + (2)( 12 ) (3)(1) + (2)(− 32 )


  
3 2
1 0  12 − 32 (1)(0) + (0)( 12 ) (1)(1) + (0)(− 32 )
= 10 01

4 Cramer’s Rule
Suppose:
Equation 1 a1 x1 + a2x2 = d1

Equation 2 b1 x1 + b2 x2 = d2
or
A  x  = d 
a1 a2 x1 = d1
b1 b2 x2 d2
where
A = a1b2 − a2b1 = 0
Solve for x1 by substitution
From equation 1
x2 = d1 −a a1x1
2

13
and equation 2
x2 = d2 −b b1x1
2

therefore:
d1 − a1x1 = d2 − b1x1
a2 b2
Cross multiply
d1b2 − a1b2x1 = d2 a2 − b1a2x1
Collect terms
d1 b2 − d2a2 = (a1 b2 − b1a2)x1

x1 = da1bb2 −− db 2aa2
1 2 1 2

The denominator is the determinant of |A|


The numerator is the same as the denominator except d1 d2 replaces a1b1.
Cramer’s Rule
 
d1 
 a2 
d  b2  d1b2 − d2a2
x1 = a2 
 a2  = a1b2 − b1a2
1 
b1  b2 
Where the d vector replaces column 1 in the A matrix
To find x2 replace column 2 with the d vector
 
a1  d1 
d2  a1d2 − d1b1

b 
x2 = a1 
 a2  = a1b2 − b1a2
1 
b1  b2 
Generally: to find xi,replace column i with vector d; find the determinant.
xi = the ratio of two determinants
xi = AA
|
|
i|
|

4.0.1 Example: The Market Model


Equation 1 Qd = 10 P Or Q + P = 10 −

Equation 2 Qs = P − 2 Or − Q+P =2
Matrix form
A  x  = d 
1 1 Q 10
−1 1 P =
2

| A
| = (1)(1) − (−1)(1) = 2

Find Qe  
 10 1 
 
 
Qe =
2 1 10 − 2
= =4
2 2

14
Find Pe 



 1 10 
 
Pe = −1

2
2
=
2 − (−10)
2
=6

Substitute P and Q into either equation 1 or equation 2 to verify


Qd = 10 P −

10 − 6 = 4

4.0.2 Example: National Income Model


Y = C + I0 + G0 Or Y C = I0 + G0 −

C = a + bY Or bY + c = a −
  
In matrix form 1 −1 Y = I0 + G0
− b 1 C a
Solve for Ye 
 I0 + G 0

 1  −

Y e =  a1 1 1 = I0 +1 G0b+ a
 
  − −
 b 1 −

Solve for Ce  

 1 I0 + G0 

Ce =
 −

b a  
=
a + b(I0 + G0)

 1 −1 
 1− b
 − b 1 

15

You might also like