Notes on Solving Di¤erence Equations Yulei Luo SEF of HKU

September 13, 2012

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

1 / 36

Discrete-time, Di¤erences, and Di¤erence Equations The note is largely based on Fundamental Methods of Mathematical Economics (by Alpha C. Chiang and Kevin Wainwright, 4th edition, 2005). When time is taken to be a discrete variable, so that the variable t is allowed to take integer values only, the concept of the derivative will no longer appropriate (it involves in…nitesimal changes, dt) and the change in variables must be described by so called di¤erences (∆t ). Accordingly, the techniques of di¤erence equations need to be developed. We may describe the pattern of change of y by the following di¤erence equations: ∆yt +1 = 2 or ∆yt +1 = where ∆yt +1 = yt +1 Luo, Y. (SEF of HKU)

(1) 0.1yt

(2)

yt . Di¤erence Equations

September 13, 2012

2 / 36

Solving a FO Di¤erence Equation

Iterative Method. For the FO case, the di¤erence equation describes the pattern of y between two consecutive periods only. Given an initial value y0 , a time path can be obtained by iteration. Consider yt +1

yt = 2 with y0 = 15, y1 = y0 + 2 y2 = y1 + 2 = y0 + 2 (2)

and in general, for any period t, yt = y0 + t (2) = 15 + 2t.

Luo, Y. (SEF of HKU)

Di¤erence Equations

(3)

September 13, 2012

3 / 36

. Consider yt +1 = 0.9yt with y0 . By iteration, y1 = 0.9y0 , y2 = (0.9)2 y0 yt

= (0.9)t y0

(4)

Consider the following homogeneous di¤erence equation myt +1

nyt = 0 =) yt +1 =

n m

t

y0 ,

(5)

which can be written as a more general form yt = Ab t .

Luo, Y. (SEF of HKU)

Di¤erence Equations

(6)

September 13, 2012

4 / 36

General Method to Solve FO Di¤erence Equation Suppose that we are solving the FO DE: yt +1 + ayt = c

(7)

The general solution is the sum of the two components: a particular solution yp (which is any solution of the above DE) and a complementary function (CF) yc . Let’s …rst consider the CF. We try a solution of the form yt = Ab t , Ab t +1 + aAb t = 0 =) b + a = 0 or b =

a,

which means that the CF should be yc = A ( a)t

(8)

Consider now the particular solution. We try the simplest form yt = k, c c =) the PI is yp = k + ak = c =) k = (a 6 = 1) . 1+a 1+a (9) Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

5 / 36

(conti.) If it happens that a =

1, try another solution form yt = kt,

k (t + 1) + akt = c =) k =

= ct (a =

yp

c = c. t + 1 + at 1) .

(10)

The general solution is then yt = A ( a)t +

c or yt = A ( a)t + ct (a = 1+a

1)

(11)

Using the initial condition yt = y0 when t = 0, we can easily determine the de…nite solution: c c =) A = y0 (a 6 = 1+a 1+a = A + c 0 =) A = y0 (a = 1)

y0 = A + y0

Luo, Y. (SEF of HKU)

Di¤erence Equations

1) or

September 13, 2012

6 / 36

The Dynamic Stability of Equilibrium

In the discrete-time case, the dynamic stability depends on the Ab t term. The dynamic stability of equilibrium depends on whether or not the CF (Ab t ) will tend to zero as t ! ∞. We can divide the range of b into seven distinct regions: see Figure 17.1. Nonoscillatory if b > 0 ; Oscillatory if b < 0

Divergent if jb j > 1 Convergent if jb j < 1

The role of A. First, it can produce a scale e¤ect without changing the basic con…guration of the time path. Second, the sign of A can a¤ect the shape of the path: a negative A can produce a mirror e¤ect as well as a scale e¤ect.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

7 / 36

The Cobweb Model A variant of the market model: it treats Qs as a function not of the current price but of the price of the preceding time period, that is, the supply function is lagged or delayed. Qs ,t = S (Pt

1)

(12)

When this function interacts with a demand function of the form Qd ,t = D (Pt ) ,interesting price dynamics will appear. Assuming linear supply and demand functions, and the market equilibrium implies Qs ,t Qd ,t Qs ,t

Luo, Y. (SEF of HKU)

= Qd ,t = α βPt (α, β > 0) = γ + δPt 1 (γ, δ > 0) . Di¤erence Equations

September 13, 2012

(13) (14) (15)

8 / 36

(conti.) In equilibrium, the model can be reduced to the following FO DE βPt + δPt 1 = α + δ =) α+δ δ Pt + 1 + Pt = β β

(16)

Consequently, we have Pt =

P0

α+γ β+δ

t

δ β

+

α+γ . β+δ

(17)

γ The particular integral P = αβ+ +δ is the intertemporal equilibrium price of the model. We can rewrite the price dynamics as follows

Pt = P0

Luo, Y. (SEF of HKU)

P

Di¤erence Equations

δ β

t

+ P.

(18)

September 13, 2012

9 / 36

(conti.) P0 P can have both the scale e¤ect and the mirror e¤ect on the price dynamics. Given our model speci…cation (δ, β > 0), we can deduce an oscillatory time path because βδ < 0. That’s why we call the model the Cobweb model. The model has three possibilities of oscillation patterns: 8 < Explosive if δ > β Uniform if δ = β : Damped if δ < β See Figure 17.2 in CW.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

10 / 36

Nonlinear Di¤erence Equations-The Qualitative-Graphic Approach When nonlinearity occurs in the case of FO DE models, we can use the graphic approach (Phase diagram) to analyze the properties of the DE. Consider the following nonlinear DEs yt +1 + yt3 = 5 or yt +1 + sin yt

ln yt = 3 =)

yt +1 = f (yt ) when yt +1 and yt are plotted against each other, the resulting diagram is a phase diagram and the curve corresponding to f is a phase line. See Figure 17.4. The …rst two phase lines, f1 and f2 , are characterized by positive slopes f10 2 (0, 1) and f20 > 1 and the remaining two, f3 and f4 , are negatively sloped f30 2 ( 1, 0) and f40 < Luo, Y. (SEF of HKU)

Di¤erence Equations

1 September 13, 2012

11 / 36

(conti.) For the phase line f1 , the iterative process leads from y0 to y in a steady path, without oscillation. For the phase line f2 (whose slope is greater than 1), a divergent path appears. For phase lines, f3 and f4 , the slopes are negative. The oscillatory time paths appear. Summary: The algebraic sign of the slope of the phase line determines whether there will be oscillation, and the absolution value of its slope governs the question of convergence.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

12 / 36

Second Order Di¤erence Equation

A second-order di¤erence equation involves the second di¤erence of y: ∆2 yt +2 = ∆ (∆yt +2 ) = ∆ (yt +2

= (yt +2 yt +1 ) (yt +1 = yt +2 2yt +1 + yt ,

yt +1 ) yt ) (19)

where ∆ is the …rst di¤erence.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

13 / 36

SO Linear DEs with Constant Coe¢ cients and Constant Term A simple variety of SO equation takes the form yt +2 + a1 yt +1 + a2 yt = c

(20)

We …rst discuss particular solution. As usual, try the simplest solution form yt = k, which means that yp = k = In case a1 + a2 = means that

c ( 1 + a 1 + a2 6 = 0 ) 1 + a1 + a2

1, try another solution form yt = kt, which yp = kt =

Luo, Y. (SEF of HKU)

(21)

c t a1 + 2

Di¤erence Equations

(22)

September 13, 2012

14 / 36

(conti.) We next discuss the complementary function which is the solution of the reduced homogenous equation (c = 0). As in the FO DE case, try the following solution form yt = Ab t =) Ab

t +2

t +1

(23)

t

+ a1 Ab + a2 Ab = 0 =) 2 b + a1 b + a2 = 0

This quadratic characteristic equation have two roots: q a1 a12 4a2 b1 , b2 = 2

(24) (25)

(26)

and both should appear in the general solution of the reduced DE. There are three possibilities.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

15 / 36

Case 1 (distinct real roots) When a12 4a2 > 0, the CF can be written as yc = A1 b1t + A2 b2t .

(27)

Example: Consider yt +2 + yt +1

2yt = 12,

(28)

yt = A1 + A2 ( 2)t + 4t

(29)

which means that b1 = 1, b2 =

2,

where A1 and A2 can be determined by two initial conditions y0 = 4 and y1 = 5 : 4 = A1 + A2 and 5 = A1 + A2 ( 2) + 4 =) A1 = 3 and A2 = 1.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

16 / 36

Case 2 (repeated real roots) When a12 4a2 = 0, the CF can be written as yc = A3 b t + A4 tb t . (30) Example: Consider yt +2 + 6yt +1 + 9yt = 4, which means that b1 = b2 =

(31)

3,

y t = A3 ( 3 ) t + A4 t ( 3 ) t +

1 4

(32)

where A1 and A2 can be determined by two initial conditions y0 and y1 .

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

17 / 36

Case 3 (complex roots) When a12

a1 2

where h =

4a2 < 0,

b1 , b2 = h vi p 2 a1 +4a2 and v = . The CF is 2

yc = A1 b1t + A2 b2t = A1 (h + vi )t + A2 (h

vi )t .

(33)

De Moivre theorem implies that

(h where R=

Luo, Y. (SEF of HKU)

p

vi )t = R t (cos θt

h2 + v 2 =

p

a2 , cos θ =

Di¤erence Equations

i sin θt ) h v , sin θ = R R

September 13, 2012

(34)

18 / 36

(conti.) The CF can be rewritten as yc

= A1 R t (cos θt + i sin θt ) + A2 R t (cos θt i sin θt ) (35) = R t [(A1 + A2 ) cos θt + (A1 A2 ) i sin θt ] = R t (A5 cos θt + A6 i sin θt ) (36)

where R and θ can be determined once h and v become known. Example: Consider yt +2 + 14 yt = 5,which means that h = 0, v = 12 , R yc

= =

Luo, Y. (SEF of HKU)

s

0+

1 2

1 2

2

1 π = , cos θ = 0, sin θ = 1, θ = =) (37) 2 2

t

A5 cos

π π t + A6 i sin t . 2 2

Di¤erence Equations

(38)

September 13, 2012

19 / 36

The Convergence of Time Path The convergence of time path y is determined by the two characteristic roots of the SO DE. In Case 1 if jb1 j > 1 and jb2 j > 1, then both components in the CF will be explosive and yc must be divergent. if jb1 j < 1 and jb2 j < 1, then both components in the CF will converge to 0 as t goes to in…nity, as will yc also. if jb1 j > 1 and jb2 j < 1, then A2 b2t tend to converge to 0, while A1 b1t tends to deviate further from 0 and will eventually render the path divergent.

Call the root with higher absolute value the dominant root since this root sets the tone of the time path. A time path will converge i¤ the dominant root is less than 1 in absolute value. The non-dominant root also a¤ects the time path, at least in the beginning periods. Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

20 / 36

In Case 2 (repeated roots), for the term A4 tb t , if jb j > 1, the b t term will be explosive. and the multiplicative t term also serves to intensify the explosiveness as t increases. if jb j < 1, the b t term will be converge. and the multiplicative t will o¤set the convergence as t increases. It turns out the damping force b t of will eventually dominant the exploding force t. Hence, the basic requirement for convergence is still that the root be less than 1 in absolution value.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

21 / 36

In Case 3 (complex roots), The term A5 cos θt + A6 i sin θt produces a ‡uctuation pattern of a periodic nature. Since time is discrete, the resulting path displays a sort of stepped ‡uctuation. The term R t determines the convergence of y : determines whether the stepped ‡uctuation is to be intensi…ed or mitigated as t increases. Hence, the basic requirement for convergence is still that the root be less than 1 in absolution value. The ‡uctuation can be gradually narrowed down i¤ R < 1 (Note that R is just the absolute value of the complex roots h vi).

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

22 / 36

Di¤erence Equations System

So far our dynamic analysis has focused on a single di¤erence equation. However, some economic models may include a system of simultaneous dynamic equations in which several variables need to be handled. Hence, the solution method to solve such dynamic system need to be introduced. The dynamic system with several dynamic equations and several variables can be equivalent with a single higher order equation with a single variable. Hence, the solution of a dynamic system would still include a set of PI and CF, and the dynamic stability of the system would still depend on the absolution values (for di¤erence equation system) of the characteristic roots in the CF.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

23 / 36

The Transformation of a Higher-order Dynamic Equation

In particular, a SO di¤erence equation can be rewritten as two simultaneous FOC equations in two variables. Consider the following example: yt +2 + a1 yt +1 + a2 yt = c (39) If we introduce an arti…cial new variable x, de…ned as xt = yt +1 , we can then express the original SO equation by the following two FO DE xt +1 + a1 xt + a2 yt yt +1

Luo, Y. (SEF of HKU)

xt

Di¤erence Equations

= c = 0

(40) (41)

September 13, 2012

24 / 36

Solving Simultaneous Dynamic Equations Suppose that we are given xt +1 + 6xt + 9yt yt +1

xt

= 4 = 0

(42) (43)

To solve this two-DE system, we still need to seek the PI and the CF, and sum them to obtain the desired time paths of the two variables x and y . We …rst solve for the PI. As usual, try the constant solution: yt +1 = yt = y and xt +1 = xt = x =) 1 x = y= . 4

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

25 / 36

For the CF, try the following function forms xt = mb t and yt = nb t where m and n are arbitrary constants and b represents the characteristic root. Next, we need to …nd the values of m, n, and b that satisfy the reduced version. Substituting these guessed solutions into the above dynamic system and cancelling out the common term b t gives

(b + 6) m + 9n = 0 m + bn = 0

(44) (45)

which is a linear homogeneous-equation system in m and n. We can rule out the uninteresting trivial solution (m = n = 0) by requiring that b+6 9 = b2 + 6b + 9 = 0 (46) 1 b This characteristic equation have two roots b (= b1 = b2 ) = Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

3. 26 / 36

(conti.) Given each bi (i = 1, 2), the above homogeneous equation implies that there will have an in…nite number of solutions for (m, n ) mi = ki ni

(47)

For this repeated-root case, we have xt = m1 ( 3)t + m2 t ( 3)t , yt = n1 ( 3)t + n2 t ( 3)t which must satisfy yt +1 = xt : n1 ( 3)t +1 + n2 (t + 1) ( 3)t +1 = m1 ( 3)t + m2 t ( 3)t =) m1 =

3 (n1 + n2 ) , m2 =

3n2

Setting n1 = A3 and n2 = A4 gives xc yc

= 3A3 ( 3)t 3A4 (t + 1) ( 3)t = A3 ( 3 ) t + A4 t ( 3 ) t

(48) (49)

Note that both time paths have the same ( 3)t term, so they both explosive oscillation. Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

27 / 36

Matrix Notation

We can analyze the above dynamic system by using matrix. The above two-equation system can be written as xt +1 6 9 xt 4 1 0 + = yt +1 1 0 yt 0 0 1 | {z }| {z } | {z }| {z } | {z } u

I

K

v

(50)

d

Try a constant PI …rst,

(I + K )

Luo, Y. (SEF of HKU)

x y

= d =)

x y

= (I + K )

Di¤erence Equations

1

d=

1/4 1/4

September 13, 2012

.

28 / 36

(conti.) Next, try the CF u =

mb t +1 nb t +1

=

m n

(bI + K )

m n

=0

b t +1 and v =

m n

b t =)

To avoid the trivial solution, we must have

jbI + K j = 0 =) b = 3 =) mi = ki ni , where ni = Ai , mi = ki Ai where Ai are arbitrary constants.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

29 / 36

(conti.) With distinct real roots, xc yc

=

m1 b1t + m2 b2t n1 b1t + n2 b2t

=

k1 A1 b1t + k2 A2 b2t A1 b1t + A2 b2t

.

(51)

With repeated roots, xc yc

=

m1 b1t + m2 tb2t n1 b1t + n2 tb2t

(52)

The general solution can be written as xt yt

Luo, Y. (SEF of HKU)

=

xc yc

Di¤erence Equations

+

x y

.

(53)

September 13, 2012

30 / 36

Two-Variable Phase Diagram: Discrete-time Case Now we shall discuss the qualitative-graphic (phase-diagram) analysis of a nonlinear di¤erence equation system. Speci…cally, we focus on the following two-equation system xt +1

xt

yt +1

yt

= f (xt , yt ) = g (xt , yt )

(54) (55)

which is called autonomous system (t is not an explicit argument in f and g ). The two-variable phase diagram (PD) can answer the qualitative questions: the location and the dynamic stability of the intertemporal equilibrium. The most crucial task of the PD is to determine the direction of movement of the two variables over time. In the two-variable case, we can also draw the PD in the space of (x, y ). Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

31 / 36

(Conti.) In this case, we have two demarcation lines: ∆xt +1 = xt +1

xt = f (xt , yt ) = 0

(56)

∆yt +1 = yt +1

yt = g (xt , yt ) = 0

(57)

which interact at point E representing the intertemporal equilibrium (∆xt +1 = 0 and ∆yt +1 = 0) and divide the space into 4 regions. (will be speci…ed later.) If the demarcation line can be solved for y in terms of x, we can plot the line in the (x, y ) space. Otherwise, we can use the implicit-function theorem to derive: slope of ∆xt +1 = slope of ∆yt +1 =

dy j∆x =0 = dx t +1 dy j∆y =0 = dx t +1

∂f /∂x = ∂f /∂y ∂g /∂x = ∂g /∂y

fx ; fy gx . gy

Speci…cally, we assume that fx < 0, fy > 0, gx > 0, gy < 0,which means that both slopes are positive. Further assume that ffyx > Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

(58) (59)

gx gy

.

32 / 36

(conti.) The two curves, at any other point, either x or y changes over time according to the signs of ∆xt +1 and ∆yt +1 at that point: d (∆xt +1 ) = fx < 0, dx

(60)

which means that as we move from west to east in the space (as x increases), ∆xt +1 decrease so that the sign of ∆xt +1 must pass through three stages, in the order: +, 0, . Similarly, d (∆yt +1 ) = gy < 0, dy

(61)

which means that as we move from south to north in the space (as y increases), ∆yt +1 decreases so that the sign of ∆yt +1 must pass through three stages, in the order: +, 0, .

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

33 / 36

Linearization of a Nonlinearization Di¤erence-Equation System Another qualitative technique of analyzing a nonlinear di¤erence equation system is to examine its linear approximation which is derived by using the Taylor expansion of the system around its intertemporal equilibrium. At the point of expansion (i.e., the IE), the linear approximation has the same equilibrium as the original nonlinear system. In a su¢ ciently small neighborhood of E, the linear approximation should have the same general streamline con…guration as the original system. As long as we con…ne our stability analysis to the immediate neighborhood of the IE, the approximated system can include enough information from the original nonlinear system. This analysis is called local stability analysis.

Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

34 / 36

(Conti.) For the two di¤erence equation system, we have ∆xt +1 = f (x0 , y0 ) + fx (x0 , y0 ) (x

x0 ) + fy (x0 , y0 ) (y

∆yt +1 = g (x0 , y0 ) + gx (x0 , y0 ) (x

x0 ) + gy (x0 , y0 ) (y

y0 ) y0 )

For purpose of local stability analysis, the above linearization can be put a simpler form. First, the expansion point is the IE, (x, y ) and f (x, y ) = g (x, y ) = 0. We then have another form of linearization xt +1 yt +1

(1 + fx (x, y )) x fy (x, y ) y = gx (x, y ) x (1 + gy (x, y )) y =

fx (x, y ) x

fy (x, y ) y

gx (x, y ) x

gy (x, y ) y

which means that xt +1 yt +1

Luo, Y. (SEF of HKU)

x y |

1 + fx gx

fy 1 + gy {z JE

Di¤erence Equations

(x ,y )

}

xt yt

x y

=

0 0

September 13, 2012

.

35 / 36

(Conti.) The Jacobian matrix JE in the above reduced system can determine the local stability of the equilibrium. Denote 1 + fx gx

JE =

fy 1 + gy

= (x ,y )

a b c d

(62)

The characteristic roots of the reduced linearization is r

a b c r d

= r2

(a + d ) r + (ad

bc ) = 0 =)

trace (JE ) = r1 + r2 = a + d = 2 + fx + gy

(63)

det (JE ) = r1 r2 = ad r1 , r2 =

bc = (1 + fx ) (1 + gy ) fy gx =) (64) q trace (JE ) (trace (JE ))2 4 det (JE ) 2

There are also four cases for the local stability of the above system, but here we only focus on the most popular economic case: The saddle-point case in which r1 > 1 and r2 < 1. Luo, Y. (SEF of HKU)

Di¤erence Equations

September 13, 2012

36 / 36