You are on page 1of 50

EFIMM 0023

MRes Mathematics for Economists

Santiago Oliveros
University of Bristol
Today we cover SB Ch 23.1-23.5

TB1 2023

1 / 50
Economic Dynamics

Difference Equations
and
Linear Algebra

2 / 50
Motivation: SIR model

2020 has brought very bad news to all of us: COVID-19


We have heard about herd immunity, R0 , survival rates,
etc.
Where are those words coming from?
They come from what is known as the “classical”
S(usceptible)I(nfectious)R(ecovered) model

3 / 50
Motivation: formal SIR(D) model

There are four groups of people: st , it , dt , and rt .


These are proportions so
st + it + dt + rt = 1 (1)
People transition from state to state:
Susceptible people transition to infections with some
probability (πt ) if they are in contact with infected
people:
st +1 − st = −πt ct it (2)
Infected people can recover (with probability β t ), die
(with probability αt ), or remain infected:
rt +1 − rt = β t it dt +1 − dt = αt it (3)
4 / 50
What is this second part of the unit about

We are going to learn tools to solve these dynamic


models and apply these tools to economic problems.
First we are going to learn some mathematical tools
related to matrix algebra
Then we are going to learn some more tools that have
direct economic applications.
1 Difference equations.
2 Markov Chains.
3 Differential equations.

5 / 50
Diagonalization

6 / 50
Motivation: Solving SIR model

Assume that the epidemiological parameters are fixed

πt = π αt = α βt = β

Furthermore, assume that the economic parameter is also


constant ct = c
Combining (1)-(3) we get the system

it +1 = (1 − α − β + πc )it st +1 = st − πcit

7 / 50
Motivation: Solving SIR model

In matrix form we get


     
it +1 1 − α − β + πc 0 i
= × t
st + 1 −πc 1 st
| {z } | {z } |{z}
zt +1 A zt

Applying the same equation multiple times we get

zt +1 = At +1 × z0

It is important to understand the behavior of the matrix


A.

8 / 50
Difference Equations: definition

A single difference equation is an expression of the


following form:

xt = f (xt −1 , xt −2 ...xt −T ; t )

There are important concepts that we need to agree on


Order: it is the number T (how many lags are we
considering)
Autonomous: it does not depend directly on t but just
on the lagged variables
Linear: when ∂x∂ft −j = αj for all j

9 / 50
Difference Equations: definition

When xt is a vector, we refer to a system of difference


equations:
While being linear and autonomous is straight forward,
the notion of order in a system of difference equations is
a little more complicated
We will talk about this more later but it suffices to say
that is not a good idea to talk about order in systems.
In our particular example we have a system that is linear
and autonomous.

10 / 50
Reducing the problem

Definition
A matrix A ∈ Rk ×k is diagonalizable if there is a non-singular
matrix P ∈ Rk ×k such that

P −1 × A × P = D

where D is a diagonal matrix


 
r1 0 0 ... 0
 0 r2 0 ... 0 
D= 
.... ... .... ... ...
0 0 0 ... rk

Why is this useful? 11 / 50


Reducing the problem

Let’s multiple D by D multiple times

D 2 = [P −1 × A × P ] × [P −1 × A × P ] = [P −1 × A2 × P ]
D 3 = [P −1 × A2 × P ] × [P −1 × A × P ] = [P −1 × A3 × P ]
....
D t = [P −1 × At × P ] ⇒ At = [P × D t × P −1 ]

And
(r1 )t
 
0 0 ... 0
 0 (r2 )t 0 ... 0 
Dt = 
 ....

... .... ... ... 
0 0 0 ... (rk )t

12 / 50
Reducing the problem

The problem now is not to multiply A by A, t times but


to find r1 , ....rk and the matrix P
Is this good?
Dynamic systems usually involve many iterations, so t
tends to be big...it looks economical
But there is more to it...as the system

zt +1 = At +1 × z0

can be studied by looking at r1 , ....rk .


For example, if |rj | < 1 for all j = 1, ....k, then
lim D t = 0
t →∞

13 / 50
Reducing the problem

We are going to show that:


1 Each r1 , ....rk is called an eigenvalue of the matrix A,
and finding them is like solving an equation of degree k.
2 Each one of the k eigenvalues of the matrix A is
associated with a (I am lying here but bear with me)
special vector that we refer to as eigenvector
3 The eigenvectors are easy to construct.
4 The matrix P is composed of the k eigenvectors of the
matrix A
Most importantly, a lot of information of the dynamic
system comes by just looking at the eigenvalues.

14 / 50
Eigenvalues and Eigenvectors

15 / 50
Eigenvalues

Definition
r is an eigenvalue of the square matrix [A] if and only if the
matrix [A − rI ] is singular or det [A − rI ] = 0.

A matrix A ∈ Rk ×k has k eigenvalues.


The eigenvalues of a diagonal matrix are the elements of
the diagonal.

16 / 50
Examples

 
a1 a2
Consider a square matrix A = , then
a3 a4
 
a1 − r a2
det [A − rI ] = det = (a1 − r )(a4 − r ) − a2 a3
a3 a4 − r | {z }
characteristic polinomial

= a1 a4 − a2 a3 − ( a1 + a4 ) r + r 2
= det[A] − tr ([A])r + r 2
s 2
tr ([A]) tr ([A])
→r = ± − det([a])
2 2
→ r1 + r2 = tr ([A]) r1 r2 = det([A])

17 / 50
Eigenvectors

Definition
The non-zero vector v is an eigenvector of the eigenvalue r of
the square matrix [A] if and only if [A − rI ] × v = [0].

Note that
→ →
0 = [A − rI ] × ~v = [A] × v − r × [I ] × v
→ →
= [A] × v − r × v
→ →
→ [A] × v = r × v

In a sense, each combination of eigenvector and


eigenvalue of the matrix [A] decompose the matrix [A] in
a special way.
18 / 50
Example

Consider the following matrix


 
1 0 1
0 2 0
4 0 3

Calculate all eigenvalues and all eigenvectors...for tutorial.

19 / 50
Using the eigenvalues and eigenvectors

Consider the square matrix [A] ∈ Rk ×k , and let


~vj ∈ Rk ×1 be the eigenvector associated with the
eigenvalue rj
Let’s construct the square matrix
P = [~v1 , ~v2 , ...~vk ] ∈ Rk ×k
Let’s calculate the following product
A × P = A × [~v1 , ~v2 , ...~vk ] = [A × ~v1 , A × ~v2 , ...A × ~vk ]
= [r1 × ~v1 , r2 × ~v2 , ...rk × ~vk ]
 
r1 0 .... 0
 0 r2 .... 0 
= [~v1 , ~v2 , ...~vk ] ×  
... ... .... ...
0 0 .... rk
20 / 50
Using the eigenvalues and eigenvectors

Using the definition of P we have


 
r1 0 .... 0
 0 r2 .... 0 
A×P = P ×
... ...

.... ...
0 0 .... rk
 
r1 0 .... 0
0 r2 .... 0 
→ P −1 AP = 


... ... .... ...
0 0 .... rk

21 / 50
Using the eigenvalues and eigenvectors

Recall that our dynamic system was

zt +1 = [A] × zt

The problem here is that [A] is not diagonal yet


Let’s use the matrix [P ] of eigenvectors of A to create
the variable
Ẑt ≡ [P ]−1 × zt
Note that

[P ]−1 zt +1 = [P ]−1 [A] × zt


Ẑt +1 = [P ]−1 [A][P ] × Ẑt

22 / 50
Using the eigenvalues and eigenvectors

 
r1 0 .... 0
 0 r2 .... 0 
Ẑt +1  0 0 .... 0  × Ẑt
= 

0 0 .... rk
( r1 ) t + 1
 
0 .... 0
 0 (r2 )t +1 .... 0   × Ẑ0
Ẑt +1 =
 0 0 .... 0 
0 0 .... (rk )t +1
(r1 )t +1 (z0 )1
 
 (r2 )t +1 (z0 )2 
Ẑt +1 = 
 .... 
t + 1
(rk ) (z0 )k
23 / 50
Using the eigenvalues and eigenvectors

(r1 )t +1 (z0 )1
 
 (r2 )t +1 (z0 )2 
[P ] × Ẑt +1 = [P ] ×  
 .... 
t + 1
(rk ) (z0 )k
(r1 )t +1 (z0 )1
 
 (r2 )t +1 (z0 )2 
zt + 1 = [~v1 ~v2 ....~vk ] ×  
 .... 
t + 1
(rk ) (z0 )k
k
zt + 1 = ∑ (rj )t +1 (z0 )j × ~vj
j =1

24 / 50
Using the eigenvalues and eigenvectors

Note that we still need to find the constants (z0 )j but


that is easy to do by assuming that t + 1 = 0 so
k
z0 = ∑ (z0 )j × ~vj
j =1

In order to find the dynamics of the linear system we need


to get some information (in this case z0 ).
In principle, it could be any other moment that we have
some information.

25 / 50
Properties of Eigenvalues

Recall that the eigenvalues of a square matrix A ∈ Rk ×k


are all the numbers r such that

kA − rI k = 0

Finding those numbers is finding the roots of a


characteristic equation:
k
∑ ai r i = 0
i =0

26 / 50
Properties of Eigenvalues

The solution to this equation could yield:


All roots that are different, either real or complex
Some of the roots are equal, either real or complex
For k ≤ 3 it turns out that we have the following
possibilities
All real roots
All different or some roots are repeated.
Complex numbers
Always conjugate complex numbers and if k = 3, an
extra real root

27 / 50
Properties of Eigenvalues

Theorem
Let A ∈ Rk ×k be a matrix and r1 , ...rk its eigenvalues, then
The sum of the eigenvalues of A is equal to the trace of
A (the sum of all elements of the diagonal)
The product of the eigenvalues is equal to determinant of
A

This is one of the reasons why math is like magic

28 / 50
Putting all together

Recall that the dynamic system of our SIR(D) model was


     
it +1 1 − α − β + πc 0 i
= × t
st + 1 −πc 1 st
| {z } | {z } |{z}
zt +1 A zt

So we have that the roots verify

r1 + r2 = 2 − α − β + πc and r1 × r2 = 1 − α − β + πc

If 1 − α − β + πc > 0 both roots are positive (why?).

29 / 50
Putting all together

To make it more concrete (and easy) assume that


α = β = πc < 0.5 which implies that

r1 = 1 r2 = 1 − α

The eigenvectors are then


 
   
1−α 0v1j r 0 v1j
[A − rj I ]~vj = 0 → = j
−α 1v2j 0 rj v2j
   
(1 − α)v1j rv
→ = j 1j
−αv1j + v2j rj v2j
           
v 0 0 v12 d 1
→ 11 = =c and = =d
v21 c 1 v22 d 1

30 / 50
Putting all together

Recalling  
  0 d
P = ~v1 ~v2 =
c d
 
−1 −1 1 0
Zt = P zt and [P AP ] =
0 1−α
we get
     
−1 it +1 1 0 −1 it
P = ×P
st + 1 0 1−α st

31 / 50
Putting all together

It follows then
     
−1 it +1 1 0 −1 i0
P = ×P
st +1 0 (1 − α )t +1 s0

Using now that


− c1 1
 
−1 c
P = 1
d 0
we get
" #
st +1 −it +1    s0 −i0 
c 1 0
= × ic0
it +1
d
0 (1 − α )t +1 d

32 / 50
Putting all together

It follows then
st +1 − it +1 s0 − i0
=1
c c
it +1 i0
= ( 1 − α )t +1
d d
or after some algebra

st +1 = s0 − i0 1 − (1 − α)t +1


it +1 = (1 − α)t +1 i0

Note that d and c dissapear...eigenvectors can always be


scaled up.

33 / 50
Some important caveats

34 / 50
Dealing with patologies: multiple equal roots

If k = 2 and there is only 1 root, A is not diagonalizable


(unless it is already a diagonal), and we would like to
construct an almost diagonalizable matrix so that
 
−1 r 1
P AP =
0 r

This is because,

r t tr t −1
 
−1 t
[P AP ] =
0 rt

The question is then how to find the eigenvectors

35 / 50
Dealing with patologies: multiple equal roots

Recalling that
 
r 1
AP = P
0 r
 
    r 1
A ~v1 ~v2 = ~v1 ~v2
0 r
   
A~v1 A~v2 = r~v1 ~v1 + r~v2

It follows then

A~v1 = r~v1 and A~v2 = ~v1 + r~v2

36 / 50
Dealing with patologies: multiple equal roots

If k = 3 then the way to construct an almost


diagonalizable matrix depends on the number of
repetitions
If there are two roots, then
 
r1 0 0
P −1 AP =  0 r2 1 
0 0 r2
If there are three roots, then
 
r 1 0
P −1 AP = 0 r 1
0 0 r
37 / 50
Dealing with patologies: complex roots

Consider the generic matrix


 
a11 a12
A=
a21 a22
The charcateristic polinomial that gives the eigenvalues is
0 = (a11 − r )(a22 − r ) − a12 a22
0 = a11 a22 − a12 a21 − r (a22 + a11 ) + r 2 = |A| − rtr (A) + r 2
tr (A) 2 tr (A) 2
   
0 = |A| − + r−
2 2
s
tr (A) 2

tr (A)
r= ± − |A|
2 2
38 / 50
Dealing with patologies: complex roots

Theorem
Consider the generic matrix
 
a a
A = 11 12
a21 a22

The eigenvalues of A are different if and only if


 2
tr (A)
6 = |A|
2

The eigenvalues of A are real if and only if


 2
tr (A)
≥ |A|
2
39 / 50
Dealing with patologies: complex roots

Recall that the matrix that gave the dynamics of our


SIR(D) model had

tr (A) = 2 − α − β + πc |A| = (1 − α − β + πc )

The theorem then says that all roots are real and if
α + β ≤ 1 they are different.
Let’s forget about that and imagine that we actually have
complex roots.

40 / 50
Dealing with patologies: complex roots

It follows that the eigenvalues, in that case would be


s  2
tr (A) tr (A)
rj = ±i |A| − = A ± iB
2 2

Calculating the eigenvectors is the same as before:

[A] × ~v = r × [I ] × ~v
[A] × [~u + i w
~ ] = (A ± iB ) × [~u + i w
~]
The matrix P is also complex, but we know that
 
A + iB 0
[ P −1 A P ] =
0 A − iB

41 / 50
Dealing with patologies: complex roots

We can represent the dynamic system then as


 
−1 A + iB 0
[P ] ~zt = × [P −1 ] ~zt −1
0 A − iB
(A + iB )t
 
0
= × [P −1 ] ~z0
0 (A − iB )t

This still does not look good....let’s do some drawings to


understand complex numbers

42 / 50
Dealing with patologies: complex roots

Theorem ( De Moivre’s formula)


For any complex number
 2t
(A + iB )t = A2 + B 2 (cos(tθ ) + i sin(tθ ))

for
A
cos θ = √
A2 + B 2

43 / 50
Dealing with patologies: complex roots

Replacing back in our original system we have


 
 2t cos(tθ ) + i sin(tθ ) 0
[P −1 ] ~zt = A2 + B 2 × [P −1 ] ~z0
0 cos(tθ ) − i sin(tθ )
 
 t cos(tθ ) + i sin(tθ ) 0
~zt = [P ] A2 + B 2 2 × [P −1 ] ~z0
0 cos(tθ ) − i sin(tθ )

There is a lot of information here


t
If A2 + B 2 2 < 1 then the system converges
Because of the complex numbers it does present cycles

44 / 50
Summary

45 / 50
Finally....a recipe I

In general, for 2 × 2 matrices is easier to think of an


algorithm
First we apply Theorem 5 and we determine whether the
roots are real or complex, multiple or repeated
 2
tr (A)
If 2 > |A|
They are real and different so
v
tr (A) 2
u 
tr (A) u
rj = ± t − |A|
2 2

We then calculate the eigenvectors A~vj = rj~vj


The solution is then given by
zt = c1 (r1 )t~v1 + c2 (r2 )t~v2
where cj are two constants that are determined by given
conditions 46 / 50
Finally....a recipe II

tr (A) 2
 
If 2 = |A|
They are real and equal so

tr (A)
r=
2
We then calculate the eigenvectors A~v1 = r~v1 and
A~v2 = r~v2 + ~v1
The solution is then given by

zt = c1 (r )t + tc2 (r )t −1 ~v1 + c2 (r )t~v2




where cj are two constants that are determined by given


conditions
47 / 50
Finally....a recipe III

tr (A) 2
 
If 2 < |A|
They are complex and different so
v
u tr (A) 2
u
tr (A)
rj = ± it − |A|
2 2

We then calculate the eigenvectors


A[~u ± i w
~ ] = rj [~u ± i w
~j]
We transform the problem in such a way that the
solution is then given by
q
zt = |A| [cos(tθ )(c1~u − c2 w ~ − c2~u )]
~ ) + sin(tθ )(c1 w
tr (A)
for |A| cos θ = 2 and where cj are two constants that
are determined by given conditions
48 / 50
Some final comments

It is a good idea to solve exercises that are in the book:


In particular for the case of complex numbers as it
appears that z t is complex....it is not. Another math
magic:
because both the eigenvectors and eigenvalues are
complex, the complex part cancels out. More later.
The part tr t −1 is decreasing in t if and only if |r | < 1.
Check it out...
so |r | still determines whether there is convergence or
not.

49 / 50
Some final comments

There are two ways in which zn fluctuates:


Real roots with −1 < r < 0 and complex roots (recall
that sin and cos fluctuate).

When there are more than one dimension there are


multiple given conditions that are needed...
here is where economics kicks in....

50 / 50

You might also like