Dudley Cooke
Trinity College Dublin
1 / 49
Reading
1
Chapters 4 and 5 of CW
2 / 49
2
2
3
5
2 3
A=
, B = 5 10 , C =
1
7 2
1
1
4
Notation: We shall use a capital letter to denote a matrix and the
corresponding small letter to denote individual elements of a matrix.
The element in the (2, 1) position (2nd row, 1st column)
of A will be
a11 a12
denoted as a21 . So, from above, A =
.
a21 a22
The number of rows and columns in a matrix is also called its order
or dimension. For instance, the matrix A has order 2 2.
3 / 49
1 0 ... 0
0 1 ... 0
.. .. .. ..
. . . .
0 0 ... 1
A square matrix where the only non-zero entries are on the diagonal is
also called a diagonal matrix.
Dudley Cooke (Trinity College Dublin)
4 / 49
Matrices in Economics
One example of a matrix in economics is the IS-LM macro model.1
Y = C + I + G
C = a + b (1 t )Y
(resource constraint)
(consumption function)
I = e lR
(investment function)
= kY hR
M
(money demand)
We can write the above
1
b (1 t )
0
k
1 1 0
Y
1
0
0
C =
0
1
l I
0
0 h
R
G
a
5 / 49
4 3
1 2
= A2 2
1 2
5 6
4+1 3+2
1+5 2+6
5 5
8 6
= B2 2
That is, m = p = n = q = 2.
c11
a11 a12
Clearly,
and c12 cannot be added together.
a21 a22
c13
=A
22
=C31
6 / 49
B2 2
7 / 49
Scalar Multiplication
Scalar Multiplication by a number c is just multiplying each element
of the matrix by the number c.
2 1
3 9
For instance if A =
4 5 and c = 5/2 then c A is the
2 2
5
5/2
15/2 45/2
matrix
10 25/2 .
5
5
Note that scalar multiplication applies to any matrix. We can
combine the operations of scalar multiplication and addition: for
instance, you should be able to say what 5A + 3B means if A and B
have the same dimension.
Dudley Cooke (Trinity College Dublin)
8 / 49
Matrix Multiplication
9 / 49
Matrix Multiplication
10 / 49
4 3
1 2
AB =
1 2
5 6
19 17
11 14
However, BA is,
4 3
1 2
BA =
5 6
1 2
1 (4) + 2 (1) 1 (3) + 2 (2)
6 7
=
=
5 (4) + 6 (1) 5 (3) + 6 (2)
26 27
So, AB is not BA.
Again, think about this versus the scalar case. If a = 5 and b = 6,
ab = ba = 30.
Dudley Cooke (Trinity College Dublin)
11 / 49
by 2 case, we have:
a11 a12
b11 b12
a21 a22
b21 b22
a11 (b11 ) + a12 (b21 ) a11 (b11 ) + a12 (b21 )
a21 (b12 ) + a22 (b22 ) a21 (b12 ) + a22 (b22 )
c11 c12
C
c21 c22
12 / 49
Example
1 2
7
8
Suppose A = 3 4 and B =
and AB = C , if
9 10
5 6
possible.
Since A has order 3 2 and B has order 2 2, it follows that
C = AB is defined and the product is a matrix of dimension 3 2.
The individual elements of C (e.g., c11 = a11 b11 + a12 b21 ) are:
c11 = (1 7) + (2 9) = 25, c12 = (1 8) + (2 10) = 28,
c21 = (3 7) + (4 9) = 57, c22 = (3 8) + (4 10) = 64,
c31 = (5 7) + (6 9) = 89, c32 = 5 8 + 6 10 = 100.
c11 c12
25 28
Hence, C = c21 c22 = 57 64 .
c31 c32
89 100
Note that BA is not defined as elements a31 = 5 and a32 = 6 cannot
be matched with elements of B.
Dudley Cooke (Trinity College Dublin)
13 / 49
14 / 49
Commutative; a + b = b + a
Distributive; a (b + c ) = ab + ac and (b + c ) a = ba + ca
Matrix cases:
Addition
Commutative law; A + B = B + A
Associative law; (A + B ) + C = A + (B + C )
Multiplication
Associative law; (AB ) C = A (BC )
Distributive law; A (B + C ) = AB + AC and (B + C ) A = BA + CA
15 / 49
Transpose of a Matrix
16 / 49
(AT )T = A
(A + B )T
AT
+ BT .
4 3
1 2
AT
=
Suppose A =
=
1 2
1 5
and B =
BT =
. Try this at home.
5 6
2 6
4 1
3 2
(AB )T = B T AT
More generally, if we have n-matrices A1 , A2 , . . . , An then
T
T T
(A1 A2 . . . An )T = AT
n An1 . . . A2 A1
17 / 49
18 / 49
19 / 49
Pick any row or column in the matrix. Suppose we pick the ith row.
Then, the determinant of the matrix A is:
20 / 49
1 2
3 4
. We know
|A| = (1 4) (2 3) = 2.
Although its a little trivial, we can relate that to the technique for
larger matrices, as a first step.
We have,
|A| = (a11 C11 ) + (a12 C12 )
= a11 (1)1+1 M11 + a12 (1)1+2 M12
= a11 M11 a12 M12 ; M11 = 4 and M12 = 3
= a11 4 a12 3 = (1 4) (2 3) = 2
Why is this all so easy? In the 2 by 2 case, the Mij s are scalars. If
we have a 3 by 3 case, the Mij are 2 by 2 matrices, which we have to
work out the determinant of first etc...
Dudley Cooke (Trinity College Dublin)
21 / 49
3 by 3 Example
1 2 3
Suppose we have the following 3 by 3 matrix, A = 4 2 6 .
7 8 9
Let us compute the determinant by computing the co-factors of the
first row.
We have, Cij = (1)i +j Mij , so,
C11 = (1)
1+1
M11 = (1)
2 6
8 9
| {z }
1+1
M11
22 / 49
3 by 3 Example Continued
We can do this for the other 2 elements of the row. We find,
1+2 4 6
=6
C12 = (1)
7 9
| {z }
=M12
C13
1+3 4 2
= (1)
7 8
= 18
= [1 (30)] + (2 6) + (3 18) = 36
We could have chosen any other row or column. If we choose the
third column, then we have: C13 = 18, C23 = 6, C33 = 6 and
therefore = (3 18) + (6 6) + [9 (6)] = 36.
Dudley Cooke (Trinity College Dublin)
23 / 49
24 / 49
1 2 3
Consider the same matrix as before, A = 4 2 6 .
7 8 9
Note
row can
that the second
be written as
2 2 1 3 = 4 2 6 .
We know that multiplying a row by a constant leads the determinant
to change by the same factor.
It follows,
1 2 3
|A| = 2 2 1 3
7 8 9
25 / 49
Example Continued
Note
that
column
three also has
1
3
3 1 = 3 .
3
9
It follows that,
1
|A| = (2 3) 2
7
1 2 1
2 1
1 1 = 6 2 1 1
7 8 3
8 3
There are now no common factors; however we can now make use of
the row and column operations.
26 / 49
Example Continued
Since the determinant is not changed by multiplying a row (column)
by a constant and adding it to another row (column) we can use this
to make some entries in a row or column zeros.
Multiplying the first row by 1 and adding it to the second gives,
1 2 1
|A| = 6 1 1 0
7 8 3
1 2 1
What did we do? Well, we started with 6 2 1 1 and we noted,
7 8 3
T T
T
1
2
1
+ 1
= 1 , which is the new middle row
(1) 2
1
1
0
of |A|.
Dudley Cooke (Trinity College Dublin)
27 / 49
Example Continued
Similarly, multiplying the first row by 3
row gives:
1 2
|A| = 6 1 1
4 2
Following
the same idea
as before, we start out with
1 2 1
|A| = 6 1 1 0 and we note,
7 8 3
T T
T
1
7
4
+ 8
= 2 , which is the new bottom row of
(3) 2
1
3
0
|A|.
28 / 49
Example Continued
1 2 3
Why did we do all of this? Well, |A| = 4 2 6 is not that easy
7 8 9
to compute.
1 2 1
However, |A| = 6 1 1 0 is easy to compute, as we can take
4 2 0
the cofactors of the third column.
In that case, we only have to compute one cofactor since two entries
in the column are zero.
Therefore, we have,
|A| = 6 1 (1)
1+3
1 1
4 2 = 6 6 = 36
29 / 49
30 / 49
Consider the following 2 by 2 matrix A =
3 2
1 0
.
31 / 49
Consider the following 2 by 2 matrix: A =
1
3 4
. Does this
32 / 49
3 by 3 Example
Let us
compute the
inverse of the matrix that we have seen before:
1 2 3
A = 4 2 6 .
7 8 9
We already know the following:
C11 = 30, C12 = 6, C13 = 18, C23 = 6, C33 = 6
|A| = 36
Recall we can use C1j s or Ci3 s to get here.
The remaining cofactors are C21 = 6, C22 = 12, C31 = 6, C32 = 6.
Try this at home.
33 / 49
30
6
18
12 6 .
Here the matrix of cofactors is, [cij ] = 6
6
6
6
30
6
6
12 6 .
The transpose is, [cij ]T = 6
18
6
6
5
1
1
6
6
6
1
The inverse matrix is, A1 = |A1 | [cij ]T = 16 13
as
6
1
1
1
2
6 6
|A| = 36.
34 / 49
Cramers Rule
Now suppose we have a big linear model.
In its most general specification it is written as a system of linear
equations:
a11 x1 + a12 x2 + . . . + a1n xn = b1
..
..
..
..
.
.
.
.
.
= ..
an1 x1 + an2 x2 + . . . + ann xn = bn
This is system of n linear equations in n unknowns. It can be
represented
compactlyin matrix
asAx =b where,
notation
a11 . . . a1n
x1
b1
..
.
.
.
..
.. , x = .. , b = ...
A= .
.
an1 . . . ann
xn
bn
Dudley Cooke (Trinity College Dublin)
35 / 49
Cramers Rule
We note that providing |A| 6= 0 (that is, A has an inverse) we can
solve for x by just multiplying both sides of the equation Ax = b by
A1 :
(A1 )Ax = (A1 A)x = In x = x = A1 b
Cramers rule is just an alternative formula for this; the advantage of
the rule is that we can find each xi individually; this may be useful if
we dont want to find the value of all xi .
Cramers Rule states that:
xi =
|Ab,i |
|A|
Here Ab,i is the matrix where the ith column of A is replaced by the
column vector b.
Dudley Cooke (Trinity College Dublin)
36 / 49
2 3 7
w
6
y
Consider the system 4 4 4
= 2 . Here, |A| = 80;
1 5 1
z
1
A
of y and z as,
48
3
= =
80
5
37 / 49
the
system,
38 / 49
w
b1 C11 + b2 C21 + b3 C31
y = A1 b = 1 b1 C12 + b2 C22 + b3 C32
|A|
z
b1 C13 + b2 C23 + b3 C33
Now note that b1 C11 + b2 C21 + b3 C31 is nothing but the determinant
of the matrix where the first column of A has been replaced by the
vector b.
Similarly, b1 C12 + b2 C22 + b3 C32 is the determinant of the matrix
where the second column of A has been replaced by the vector b.
You can check that a similar observation holds for
b1 C13 + b2 C23 + b3 C33 . This shows that the inverse approach and
Cramers rule are identical for a system of three linear equations but
this approach can be easily extended.
Dudley Cooke (Trinity College Dublin)
39 / 49
40 / 49
41 / 49
42 / 49
M=M
We want to solve this model to determine the endogenous variables
(Y , C , I , R ) in terms of the exogenous variables
).
(G , a, b, t, e, k, h, l, M
We can use all the new tools we have developed to solve the model.
Well focus on solving for consumption as a function of monetary and
fiscal policy.
Dudley Cooke (Trinity College Dublin)
43 / 49
1
b (1 t )
0
k
1 1 0
Y
1
0
0
C =
0
1
l
I
0
0 h
R
G
a
44 / 49
Example Continued
4
2+j M . However, it is
Also Cij =
ij so = j =1 a2j (1)
2j
not as easy as before because the M2j s are 3 by 3 matrices.
45 / 49
Example Continued
Expanding the 3 3 determinant in the expression for C21 about the
first column (two zero elements), we get,
C21 = [(1)(1 (h ) 0 l )] = h
For C22 we can expand the 3 3 determinant about the first column
(one zero element):
1 l
1 0
1+1
3
+
1
+ (1)
C22 = (1)
1
k
0 h
1 l
= h kl
Hence the determinant of the original 4 4 is,
= bh (1 t ) h kl = h (1 b (1 t )) kl
Dudley Cooke (Trinity College Dublin)
46 / 49
Example Continued
We can now compute the value of any of the endogenous variables
using Cramers Rule. Suppose we want to compute C . We replace
T . Then,
the second column with G a e M
1
G 1 0
1 b (1 t ) a
0
0
C =
0
e
1
l
|A|
k
M
0 h
Computing the determinant of the
the second row, we have
2+1
= b (1 t ) (1)
1 1 0
l
0 1
k 0 h
Dudley Cooke (Trinity College Dublin)
1 0
1
l
0 h
+ a (1)2+2
47 / 49
Example Continued
The second 3 3 determinant above has already been found.
Expanding this about the first 3 3 around the first row, we have,
G 1 0
e
1
l = G (1)2 [1 (h ) 0 l ] + (1)
M
0 h
l]
(1)3 [e (h) M
).
This is (hG + he + Ml
) + a (h + kl ) =
Hence, = b (1 t ) (hG + he + Ml
) + a(h + kl )
b (1 t )(hG + he + Ml
h (1 b (1 t )) + kl
48 / 49
Roundup
Add/subtract/multiply matrices.
49 / 49