Log-linearisation Tutorial
Weijie Chen
Department of Political and Economic Studies
University of Helsinki
14 November 2011
Abstract
To solve DSGE models, firstly we have to collect all difference equations,
such as F.O.C.s, constraints, aggregate conditions, then log-linearise them
around the steady-state. It sounds easy, but it sometimes requires ingenuity
and proficiency. This note is written for illustrating log-linearisation and
presenting several methods, which method you are suppose to use depends
on the specific functional form.
1 Introduction
Log-linearisation, basically it means take the natural logarithm, then lin-
earise it. Nothing mysterious, but the challenges mainly come from a tech-
nical consideration: how can we log-linearise an equation easily? ‘Easily’ is
a relative expression, if we are about to tackle a problem, at least we are
supposed to pick the right weapon.
To perform log-linearisation, we often work with log-deviation, it is de-
fined as
x˜t = lnXt − lnX (1)
where x˜t is log-deviation, X is the stead-state of Xt. To see why we need to
work with log-deviation, we can manipulate equation above,
x˜t = ln
(
Xt
X
)
= ln
(
1 +
Xt
X
− 1
)
= ln
(
1 +
Xt
X
− X
X
)
= ln
(
1 +
Xt −X
X
)
Now we need to employ the first-order Taylor expansion,
f(xt) ≈ f(x) + f ′(x)(xt − x) (2)
where x is steady-state of xt. Take derivative of ln (1 + (Xt −X)/X) w.r.t.
Xt,
∂ ln
(
1 + Xt−XX
)
∂Xt
=
X
Xt
1
X
=
1
Xt
Then use (2), we get
x˜t = ln
(
1 +
Xt −X
X
)
≈ 1
X
(Xt −X) (3)
1
And the right-hand side of (3) is the percentage deviation from steady state
X, this is the reason we prefer to work with log-deviation. Sometimes we
choose replace Xt −X with dXt, the differential of Xt, which will be clear
in later examples.
And we can also rearrange (3),
x˜t ≈ 1
X
(Xt −X) = Xt
X
− 1
Xt ≈ X(x˜t + 1) (4)
Then use this expression to substitute into all variables.
2 Universal method
We entitle this method as universal is not because it can be employed deal-
ing with any question, but it reveals the most fundamental idea of log-
linearisation: take natural logarithm then linearise it. Let’s use a Cobb-
Douglas production function as the first example
Yt = K
α(AtLt)
1−α
Take natural logarithm on both sides,
lnYt = α lnKt + (1− α) lnAt + (1− α) lnLt (5)
2
Then we need to use Taylor expansion to the first degree around steady-
state, for every terms
lnYt = lnY +
1
Y
(Yt − Y )
lnKt = lnK +
1
K
(Kt −K)
lnAt = lnA+
1
A
(At −A)
lnLt = lnL+
1
L
(Lt − L)
Substitute back to (5),
lnY +
1
Y
(Yt − Y ) = α
[
lnK +
1
K
(Kt −K)
]
+ (1− α)
[
lnA+
1
A
(At −A)
]
+ (1− α)
[
lnL+
1
L
(Lt − L)
]
Expand the equation above
lnY +
1
Y
(Yt − Y ) = α lnK + αKt
K
− α+ (1− α) lnA+ (1− α)At
A
− (1− α) + (1− α) lnL+ (1− α)Lt
L
− (1− α) (6)
We need to eliminate the steady-state condition out of equation, according
to (5)
lnY = α lnK + (1− α) lnA+ (1− α) lnL
Then we simplified (6) a bit,
1
Y
(Yt − Y ) = αKt
K
− α+ (1− α)At
A
− (1− α) + (1− α)Lt
L
− (1− α)
3
Finally, since Y , K, A and L are only constants (parameters), we get a
perfect linear function
Yt
Y
= α
Kt
K
+ (1− α)At
A
+ (1− α)Lt
L
− (1− α)
However, as you can see from steps above, the process is quite tedious,
and the result is not log-deviation form. If the function form are compli-
cated, it is sensible to turn for other methods. The all rest of methods we
are about to see are actually derived from this fundamental one, but they
are largely simplified.
3 Total differential method
In this section, you will understand why we use dX to replace Xt −X. We
use Gal´ı and Monacelli (2005) as our example, to show you how to log-
linearise the function you see in a real paper. From Gal´ı and Monacelli
(2005), we use equation pair (6) to illustrate the total differential method,
reproduce them here
CH,t = (1− α)
(
PH,t
Pt
)−η
Ct, CF,t = α
(
PF,t
Pt
)−η
Ct (7)
They are optimal consumption allocation to domestic goods and foreign
goods.
Take logarithm upon both sides for the first equation,
lnCH,t = ln (1− α)− η lnPH,t + η lnPt + lnCt
Then take total differential of each term on its steady-state value
1
CH
dCH,t = −η 1
PH
dPH,t + η
1
P
dPt +
1
C
dCt
4
where CH , PH and P without subscripts t are steady-state value. Then
rewrite them into log-deviation form
c˜H,t = −η(p˜H,t − p˜t) + c˜t (8)
The same procedure for another equation, take logarithm on both sides
lnCF,t = lnα− η lnPF,t + η lnPt + lnCt
Take total differential on steady-state,
1
CF
dCF,t = −η 1
PF
dPF,t + η
1
P
dPt +
1
C
dCt
Then log-deviation form,
c˜F,t = −η(p˜F,t − p˜t) + c˜t (9)
This time, the linearisation goes considerably quick, and result is in log-
deviation form. The Taylor expansion to the first degree is to linearise a
nonlinear function, so it functions the same as total differential approxima-
tion. And obviously taking total differential is easier than Taylor expansion
to the first degree, this is why we prefer not to use Taylor expansion directly.
4 Uhlig’s method
In this section, we will see another interesting method proposed by Uhlig
(1999), which does not even require to take derivatives. This method is just
a further derivation of (1),
lnXt = lnX + x˜t
5
Take exponential on both sides,
Xt = e
lnX+x˜t = elnX + ex˜t = Xex˜t
Then the idea is clear, we replace every variable with its according trans-
formed term Xex˜t , where X is the steady-state value. We have several
expansion rules to follow:
ex˜t ≈ 1 + x˜t
ex˜t+ay˜t ≈ 1 + x˜t + ay˜t
x˜ty˜t ≈ 0
Et[ae
x˜t ] ≈ Et[ax˜t] + a
You get the right-hand side expression by simply taking the Taylor expansion
to the first degree. But you don’t need to use Taylor expansion every time,
using these rules will save your lots of troubles.
One important remark is that Uhlig’s method is immune to Jensen’s
inequality
lnEtX > Et lnX
A specific example of this inequality, we have seen in our advanced mi-
croeconomic textbook-risk aversion. Since here natural logarithm is strictly
concave thus the inequality always holds. Then our problem is that we can’t
simply take logarithm to a function with expectation operator. One clever
way to circumvent the problem is to use Uhlig’s method.
The example here is still from Gal´ı and Monacelli (2005), the equation
6
(10), stochastic Euler equation,
1 = βRtEt
[
(Ct+1 − hCt)−σ
(Ct − hCt−1)−σ
Pt
Pt+1
]
For sake of easy handling, we replace ξt = (Ct − hCt−1)−σ,
1 = βRtEt
[
ξt+1
ξt
Pt
Pt+1
]
(10)
Follow method in Uhlig (1999),
1 = βRer˜tEt
[
ξeξ˜t+1
ξeξ˜t
Pep˜t
Pep˜t+1
]
Use stationary condition
1 = βR
ξ
ξ
P
P
to simplify and collecting exponential terms together,
1 = Et
[
er˜t+ξ˜t+1+p˜t−ξ˜t−p˜t+1
]
Taylor expansion to the first degree on the right-hand side or simply use
expansion rules,
1 ≈ 1 + r˜t + Etξ˜t+1 + p˜t − ξ˜t − Etp˜t+1 (11)
It is already linearised at this step, but we need to find out what is ξ˜t+1 and
ξ˜t, we have previously defined
ξt = (Ct − hCt−1)−σ,
take logarithm on both sides,
ln ξt = −σ ln(Ct − hCt−1)
7
then take total differential at steady-state value,
1
ξ
dξt = −σ 1
C(1− h) [ dCt − hdCt+1]
ξ˜t ≈ −σ 1
C(1− h)
[
C
dCt
C
− hC dCt+1
C
]
ξ˜t ≈ −σ 1
1− h(c˜t − hc˜t+1)
Substitute back to (11),
0 ≈ r˜t − Et
[
σ
1− h(c˜t+1 − hc˜t)
]
+
σ
1− h(c˜t − hc˜t+1)− Et[p˜t+1 − p˜t]
Define p˜t+1 − p˜t = p˜it+1 the inflation rate, then multiply both sides by
(1− h)/σ
Et(c˜t+1 − hc˜t) + 1− h
σ
Et[p˜it+1 − r˜t] ≈ c˜t − hc˜t−1 (12)
5 Substitution method
Strictly speaking, this is not a method, it simply omits the first step of
Uhlig’s replacement, then directly come to (4). There is only one step needs
attention, we will see in next example:
Xt + a = (1− b) Yt
LtZt
Taking natural logarithm on both sides,
ln (Xt + a) = ln (1− b) + lnYt − lnLt − lnZt (13)
Use steady-state condition,
ln (X + a) = ln (1− b) + lnY − lnL− lnZ (14)
8
Subtract (14) away from (13),
ln (Xt + a)− ln (X + a) = lnYt − lnY − lnLt + lnL− lnZt + lnZ
They all become log-deviation form
X˜t + a = y˜t − l˜t − z˜t (15)
We need to find out what x˜t is, then replace X˜t + a. Here comes the step
needs attention, we use (3)
x˜t ≈ Xt −X
X
(16)
Then X˜t + a becomes
X˜t + a ≈ Xt + a− (X + a)
X + a
=
Xt −X
X + a
(17)
Since the numerator of right-hand sides of (16) and (17) are equal, we can
make use of equality and set,
X˜t + a(X + a) = x˜tX
X˜t + a =
x˜tX
X + a
Substitute back to (15),
x˜tX
X + a
= y˜t − l˜t − z˜t
This function actually can be easily linearised by total differential method,
you can try by yourself, only needs two steps, everything will be done.
9
6 Taylor Approximation
6.1 Single variable case
We can dig further to see whether we can find some tricks to largely simpli-
fied the universal method. We will work on a general case first, a nonlinear
difference equation
Xt+1 = f(Xt) (18)
where f is any nonlinear functional form you can imagine. First-order Taylor
expansion of right-hand side around the steady-state is
Xt+1 ≈ f(X) + f ′(X)(Xt −X) (19)
If we set (18) to its steady-steady condition,
X = f(X)
Then (19) becomes
Xt+1 ≈ X + f ′(X)(Xt −X)
Dividing by X,
Xt+1
X
≈ 1 + f ′(X)Xt −X
X
The left-hand side can be replaced by (4),
1 + x˜t+1 = 1 + f
′(X)x˜t
x˜t+1 = f
′(X)x˜t (20)
10
Follow this formula, we simply take derivative at the steady-state, everything
will be done.
Try an example,
kt+1 = (1− δ)kt + skαt
Use formula (20),
k˜t+1 = [sαk
α−1 + (1− δ)]k˜t
It is now linearised, since the term in the square brackets are simply param-
eters.
6.2 Multivariable case
Taylor polynomial has a vector version as well as scalar version, actually
most of functions you encounter will be multivariable rather what we had
seen in last section. Again, let’s start at the general case1,
Xt+1 = f(Xt, Yt) (21)
where f is still any nonlinear function you can imagine. The vector version
(bivariate) of first-order Taylor polynomial around the steady-state is
Xt+1 ≈ f(X,Y ) + fX(X,Y )(Xt −X) + fY (X,Y )(Yt − Y ) (22)
As you can guess, the bivariate Taylor expansion closely relates to total
derivative/differential of bivariate function. Again set steady-state condition
of (21): X = f(X,Y ), (22) becomes,
Xt+1 ≈ X + fX(X,Y )(Xt −X) + fY (X,Y )(Yt − Y )
1 We use bivariate examples here for sake of simplicity.
11
Dividing by X,
Xt+1
X
≈ 1 + fX(X,Y )(Xt −X)
X
+ fY (X,Y )
(Yt − Y )
X
1 + x˜t+1 ≈ 1 + fX(X,Y )x˜t + fY (X,Y )Y
X
(Yt − Y )
Y
x˜t+1 ≈ fX(X,Y )x˜t + fY (X,Y )Y
X
y˜t (23)
(23) is the formula we are seeking for. Try an example again,
kt+1 = (1− δ)kt + sztkαt
Then calculate partial derivatives,
fz(z, k) = sk
α
fk(z, k) = αszk
α−1 + (1− δ)
Use formula (23),
k˜t+1 ≈ skαz˜ + [αszkα−1 + (1− δ)]k
z
k˜t
Slightly rearrange,
k˜t+1 ≈ skαz˜ + αskα + (1− δ)k
z
k˜t
There are still many situations we haven’t covered in this note, you can
find some published papers and try to log-linearise those key functions by
yourself then compare the results from those provided by authors.
The End.
12
References
[1] McCandless, G. (2008): The ABCs of RBCs: An Introduction to Dy-
namic Macroeconomic Models, Harvard University Press
[2] Uhlig, H. (1999): ‘A Toolkit for Analyzing Nonlinear Dynamic Stochas-
tic Models Easily’, Computational Methods for the Study of Dynamic
Economies, Oxford University Press, Oxford, 30-61
13
Introduction
Universal method
Total differential method
Uhlig's method
Substitution method
Taylor Approximation
Single variable case
Multivariable case