Difference Equation
Difference Equation
Difference Equation
Weijie Chen
Department of Political and Economic Studies
University of Helsinki
16 Aug, 2011
Contents
1 First Order Difference Equation 2
1.1 Iterative Method . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 General Method . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 One Example . . . . . . . . . . . . . . . . . . . . . . . 6
4 Lag Operator 20
th
4.1 p -order difference equation with lag operator . . . . . . . . 21
1
Abstract
Difference equations are close cousin of differential equations, they
have remarkable similarity as you will soon find out. So if you have
learned differential equations, you will have a rather nice head start.
Conventionally we study differential equations first, then difference
equations, it is not simply because it is better to study them chronolog-
ically, it is mainly because diffence equations has a naturally stronger
bond with computational science, sometimes we even need to study
how to make a differential equation into its discrete version-difference
equation-since which can be simulated by MATLAB. Difference equa-
tions are always the first lesson of any advanced time series anal-
ysis course, difference equation largely overshadows its econometric
brother, lag operation, that is because difference equation can be ex-
pressed by matrix, which tremendously increase it power, you will see
its shockingly powerful application of space-state model and Kalman
filter.
2
where
w0
w1
w = . .
..
wt
w is a determinstic vector, later we will drop this assumption when we
study stochastic difference equations, but for the time being and simplicity,
we assume w nonstochastic yet.
Notice that
y0 = ay−1 + w0
y1 = ay0 + w1
y2 = ay1 + w2
..
.
yt = ayt−1 + wt
myt − nyt−1 = 0
1
If this is first time you hear about this, refer to my notes of differential equation[2].
3
To rearrange it in a familiar manner,
n
yt = yt−1
m
y = yp + yc
4
The process will be clear with the help of an example,
yt+1 + ayt = c
yt+1 + ayt = 0
With the knowledge of last section, we can try a solution of Abt , when I
say ‘try’ it does not mean we just randomly guess, because we don’t need
to perform the crude iterative method every time, we can make use of the
solution of previously solved equation, so
b+a=0
b = −a
yc = Abt = A(−a)t
yt+1 + ayt = c.
The most intreguing thing comes, to make the equation above hold, we can
choose any yt to satisfy it. Might to your surprise, we can even choose yt = k
for −∞ < t < ∞, which is just a constant time series, every period we have
the same value k. So
k + ak = c
c
k = yp =
1+a
You can easily notice that if we want to make this solution work, then
a 6= −1. Then the question we ask will simply be, what if a = −1? Of
course it is not define, we have to change the form of the solution, here we
use yt = kt which is similar to the one we used in differential equation,
(k + 1)t + akt = c
c
k= ,
t + 1 + at
5
because a = −1,
k = c,
Last, of course you can solve A if you have an initial condition, say yt = y0 ,
and a 6= −1,
c c
y0 = A + A = y0 −
1+a 1+a
If a = 1,
y0 = A(−a)0 + 0 = A
Then just plug them back to the according solution (2) and (3).
yt+1 − 2yt = 0
use Abt ,
Abt+1 − 2Abt = 0
b−2=0
b=2
yc = A(2)t
k − 2k = 2
k = yp = −2
yt = yp + yc = −2 + 2t A
6
If we are given an initial value, y0 = 4,
4 = −2 + 20 A
A=6
yt = −2 + 6 · 2t
∆(∆yt ) = ∆(yt+1 − yt )
∆2 yt = ∆yt+1 − ∆yt
∆2 yt = (yt+2 − yt+1 ) − (yt+1 − yt )
∆2 yt = yt+2 − 2yt+1 + yt
yt+2 + a1 yt+1 + a2 yt = c
But we better not use iterative method to mess with it, trust me, it is more
confusing then illuminating, so we come straightly to the general solution.
As we we have studied by far, the general solution is the addition of the
complementary solution and particular solution, we will talk about them
next.
b2 + a1 b + a2 = 0
7
This is our characteristic equation, same as we had seen in differential equa-
tion, high school math can sometime bring us a little fun,
p
−a1 ± a21 − 4a2
b=
2
I guess you are much familiar with it in textbook form, if we have a qudractic
eqution x2 + bx + c = 0,
√
−b ± b2 − 4ab
x=
2a
The same as we did in second-order differential equations, now we have three
cases to discuss.
Case I a21 − 4a2 > 0 Then we have two distinct real roots, and the
complementary solution will be
yc = A1 bt1 + A2 bt2
Note that, A1 bt1 and A2 bt2 are linearly independent, we can’t only use one of
them to represent complementary solution, because we need two constants
A1 and A2 .
Case II a21 − 4a2 = 0 Only one real root is available to us.
a1
b = b1 = b2 = −
2
Then the complementary solution collapses,
yc = A1 bt + A2 bt = (A1 + A2 )bt
yc = A3 bt + A4 tbt
b1 = α + iβ
b2 = α − iβ
√
4a2 −a21
where α = − a21 , β= 2 . Thus,
yc = A1 (α + iβ)t + A2 (α − iβ)t
yc = A1 kb1 kt [cos (tθ) + i sin (tθ)] + A2 kb2 kt [cos (tθ) − i sin (tθ)]
8
where kb1 k = kb2 k, because
p
kb1 k = kb2 k = α2 + β 2
Thus,
yc = A1 kbkt [cos (tθ) + i sin (tθ)] + A2 kbkt [cos (tθ) − i sin (tθ)]
= kbkt {A1 [cos (tθ) + i sin (tθ)] + A2 [cos (tθ) − i sin (tθ)]}
= kbkt [(A1 + A2 ) cos (tθ) + (A1 − A2 )i sin (tθ)
= kbkt [A5 cos (tθ) + A6 sin (tθ)]
yt+2 + a1 yy+1 + a2 yt = c
b2 − 4b + 4 = 0
(b + 2)(b − 2) = 0
yc = A1 b21 + A2 b−2
2
k − 4k + 4k = 7, which is k = 7
y = yc + yp = A1 2t − A2 (−2)t + 7
9
And we have two initial conditions, y0 = 1 and y1 = 3,
y0 = A1 − A2 + 7 = 1
y1 = 2A1 + 2A2 + 7 = 3
Solve for
A1 = −4 A2 = 2
Difinite solution is
y = yc + yp = −4 · 2t − 2(−2)t + 7
10
which is a p × 1 vector. And define
a1 a2 a3 ··· ap−1 ap
1 0 0
··· 0 0
F =0 1 0
··· 0 0
.. .. .. .. ..
. . . ··· . .
0 0 0 ··· 1 0
Finally, define
ωt
0
vt = 0
..
.
0
Put them together, we have new vector form first-order difference equation,
ψ t = F ψ t−1 + v t
you will see what is ψ t−1 in next explicit form,
yt a1 a2 a3 · · · ap−1 ap yt−1 ωt
yt−1 1 0 0 · · · 0 0 yt−2 0
yt−2 0 1 0 · · · 0 0 yt−3 0
= +
.. .. .. .. .. .. .. ..
. . . . ··· . . . .
yt−p+1 0 0 0 ··· 1 0 yt−p 0
The first equation is
yt = a1 yt−1 + a2 yt−2 + · · · + ap yt−p + ωt
which is exactly (4). And it is quite obvious for you that from second to pth
equation is simple a yi = yi form. The reason that we write it like this is
not obvious till now, but one reason is that we reduce the system down to
a first-order difference equation, although it is in matrix form, we can use
old methods to analyse it.
11
And we need to assume that ψ −1 and v 0 are known. Then old tricks of
recursive substitution,
ψ 1 = F (F ψ −1 + v 0 ) + v 1
= F 2 ψ −1 + F v 0 + v 1
Again,
ψ2 = F ψ1 + v2
= F (F 2 ψ −1 + F v 0 + v 1 ) + v 2
= F 3 ψ −1 + F 2 v 0 + F v 1 + v 2
Till step t,
Note that how we use v i here. Unfortunatly, more notations are needed. We
(t)
denote the (1, 1) elelment of F t as f11 , and so on so forth. We made these
notation in order to extract the first equation from above unwieldy system,
thus
(t+1) (t+1) (t+1) (t+1)
yt = f11 y−1 + f12 y−2 + f13 y−3 + . . . + f1p y−p
(t) (t−1)
+ f11 ω0 + f11 ω1 + . . . + f11 ωt−1 + ωt
12
If you want, you can even take partial derivative to find dynamic multi-
plier, say we find
∂yt (t)
= f11
∂ω0
(t)
this measure one-unit increase in ω0 , and is give by f11 .
λ2 − a1 λ − a2 = 0
13
3.2.1 Distinct Real Eigenvalues
Distinct eigenvalue category here corresponds to two distinct real roots in
second order. It is becoming hardcore in following content, be sure you are
well-prepared in linear algebra.
If F has p distinct eigenvalues, you should be happy, because diagonal-
ization is waving hands towards you. Recall that
A = P DP −1
F t = P Λt P −1 ,
simply because,
F 2 = P ΛP −1 P ΛP −1
= P ΛΛP −1
−1
= P Λ2 P
14
t is
Then f11
t
f11 = t11 t11 λt1 + t12 t21 λt2 + · + t1p tp1 λtp
if we denote ci = t1i ti1 , then
t
f11 = c1 λt1 + c2 λt2 + · + cp λtp
Obviously if you pay attention to,
c1 + c2 + . . . + cp = t11 t11 + t12 t21 + . . . + t1p tp1 ,
you would realize it is a scalar product, it is from the first row of P and first
column of P −1 . In other words, it is the first element of P P −1 . Magically,
P P −1 is an identity matrix. Thus,
c1 + c2 + . . . + cp = 1
This time if you want to calculate dynamic multiplier,
∂yt (t)
= f11
∂ω0
= c1 λt1 + c2 λt2 + · + cp λtp
the dynamic multiplier is a weighted average of all tth powered eigenvalues.
Here one problem must be solved before we move on, how can we find
ci ? Or is it just some unclosed form expression, we can stop here?
What we do next might look very strange to you, but don’t stop and
finish it you will get a sense of what we are preparing here.
Set ti to be the ith eigenvalue,
p−1
λi
λp−2
i
ti = ...
λ1
i
1
Then,
p−1
a1 a2 a3 · · · ap−1 ap λi
1 0 0 ···
0 0 λip−2
...
0 1 0 ··· 0 0
F ti =
.. .. .. .. .. 1
. . . ··· . . λi
0 0 0 ··· 1 0 1
p−1 p−2 1
a1 λi + a2 λi + . . . + ap−1 λi + ap
λp−1
i
p−2
=
λi
..
.
λ1i
15
Recall you have seen the characteristic equation of pth -order (5),
Rearange,
λp = a1 λp−1 + a2 λp−2 + · · · + ap−1 λ + ap (6)
Interestingly, we get what we want here, the right-hand side of last equation
is just the first element of F ti .
p
λi
λp−1
ip−2
F ti = λi
.
..
λ1i
16
This is a linear equation system, solution will look like,
1
t11 =
(λ1 − λ2 )(λ1 − λ3 ) · · · (λ1 − λp )
1
t21 =
(λ2 − λ2 )(λ2 − λ3 ) · · · (λ2 − λp )
..
.
1
tp1 =
(λp − λ2 )(λp − λ3 ) · · · (λp − λp )
Thus,
11 λp−1
1
c1 = t11 t =
(λ1 − λ2 )(λ1 − λ3 ) · · · (λ1 − λp )
λp−1
c2 = t12 t21 = 2
(λ2 − λ1 )(λ2 − λ3 ) · · · (λ2 − λp )
..
.
p1 λpp−1
cp = t1p t =
(λp − λ2 )(λp − λ3 ) · · · (λp − λp−1 )
I know all this must been quite uncomfortable to you if you don’t fancy
mathematics too much. We’d better go through a small example to get
familiar with these artilleries.
Let’s look at a second-order difference equation,
yt = 0.4yt−1 + 0.7yt−2 + ωt .
|F − λI| = 0,
which is
0.4 0.7 λ 0 0.4 − λ 0.7
F − λI = − =
1 0 0 λ 1 −λ
F − λI = λ2 − 0.4λ − 0.7
17
2
1.8
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25
18
3.2.2 Distinct Complex Eigenvalues
We also need to talk about distinct complex eigenvalues, but the example
will still resort to second-order difference equation, because we have a handy
root formula. The pace might be a little fast, but easily understandable.
Suppose we have two complex eigenvalues,
λ1 = α + iβ
λ2 = α − iβ
And modulus of the conjugate pair is the same,
p
kλk = α2 + β 2
Then rewritten conjugate pair as,
λ1 = kλk (cos θ + i sin θ)
λ2 = kλk (cos θ − i sin θ)
According to De Moivre’s theorem, to raise the power of complex number,
λt1 = kλkt (cos tθ + i sin tθ)
λt2 = kλkt (cos tθ − i sin tθ)
Back to dynamic multiplier,
∂yt
= c1 λt1 + c2 λt2
∂ωt
= c1 kλkt (cos tθ + i sin tθ) + c2 kλkt (cos tθ − i sin tθ)
rearrange, we have
19
3.2.3 Repeated Eigenvalues
If we have repeat eigenvalues, diagonalization might not be the choice, since
we might encounter singular P . But since we have enough mathematical
artillery to use, we just switch to another kind of more general diagonaliza-
tion, which is called the Jordon decomposition. Let’s give a definition first,
a h × h matrix which is called Jordon block matrix, is defined as
λ 1 0 ··· 0
0 λ 1 · · · 0
J h (λ) = 0 0 λ · · ·
.. .. .. . . .
. . . . ..
0 0 0 ··· λ
F = M J M −1
4 Lag Operator
In econometrics, the convention is to use lag operator to function as what we
did with difference equation. Essentially, they are the identical. But there
5
Study my notes of Linear Algebra and Matrix Analysis II [1].
20
is still some subtle conceptual discrepancy, difference equation is a kind of
equation, a balanced expression on both sides, but lag operator represents a
kind of operation, no different from addition, substraction or multiplication.
Lag operator will turn a time series into a difference equation.
We conventionally use L to represent lag operator, for instance,
which will be
(1 − a1 L − a2 L2 − · · · − ap Lp )yt = ωt
Because it is an operation in the equation above, some steps below might
not be appropriate, but if we switch to
(1 − a1 z − a2 z 2 − · · · − ap z p )yt = ωt ,
we can use some algebraic operation to analyse it. Multiply both sides by
z −p ,
z −p (1 − a1 z − a2 z 2 − · · · − ap z p )yt = z −p ωt
(z −p − a1 zz −p − a2 z 2 z −p − · · · − ap z p z −p )yt = z −p ωt
(z −p − a1 z 1−p − a2 z 2−p − · · · − ap )yt = z −p ωt
21
References
[1] Chen W. (2011): Linear Algebra and Matrix Analysis II, study notes
[5] Enders W. (2004): Applied Econometric Time Series, John Wiley &
Sons
22