DSGE Baseline
DSGE Baseline
DSGE Baseline
Jesús Fernández-Villaverde
Juan F. Rubio-Ramírez
1
1. Introduction
In these notes, we present a baseline sticky prices-sticky wages model. The basic structure of
the economy is as follows. A representative household consumes, saves, holds money, supplies
labor, and sets its own wages subject to a demand curve and Calvo’s pricing. The final output
is manufactured by a final good producer, which uses as inputs a continuum of intermediate
goods manufactured by monopolistic competitors. The intermediate good producers rent
capital and labor to manufacture their good. Also, these intermediate good producers face
the constraint that they can only change prices following a Calvo’s rule. Finally, there is
a monetary authority that fixes the one-period nominal interest rate through open market
operations with public debt.
1.1. Households
where β is the discount factor, h is the parameter that controls habit persistence, γ is the
inverse of Frisch labor supply elasticity, dt is an intertemporal preference shock with law of
motion:
log dt = ρd log dt−1 + σ d εd,t where εd,t ∼ N (0, 1),
Note that the preference shifters are common for all households. Also, we have selected a
utility function (log utility in consumption) whose marginal relation of substitution between
consumption and leisure is linear in consumption to ensure the presence of a balanced growth
path with constant hours.
Households can trade on the whole set of possible Arrow-Debreu commodities, indexed
both by the household j (since the household faces idiosyncractic wage-adjustment risk that
we will describe below) and by time (to capture aggregate risk). Our notation ajt+1 indicates
the amount of those securities that pay one unit of consumption in event ω j,t+1,t purchased
2
by household j at time t at (real) price qjt+1,t . To save on notation, we drop the explicit
dependence of qjt+1,t and ajt+1 on the event when no ambiguity arises. Summing over different
individual assets we can price securities contingent only on aggregate states. Households also
hold an amount bjt of government bonds that pay a nominal gross interest rate of Rt .
Then, the j − th household’s budget constraint is given by:
Z
mjt bjt+1
cjt + xjt + + + qjt+1,t ajt+1 dω j,t+1,t
pt pt
¡ ¢ mjt−1 bjt
= wjt ljt + rt ujt − μ−1
t a [ujt ] kjt−1 + + Rt−1 + ajt + Tt + zt
pt pt
where wjt is the real wage, rt the real rental price of capital, ujt > 0 the intensity of use of
capital, μ−1
t a [ujt ] is the physical cost of use of capital in resource terms, μt is an investment-
specific technological shock to be described momentarily, , Tt is a lump-sum transfer, and zt
are the profits of the firms in the economy. We assume that a [1] = 0, a0 and a00 > 0.
Investment xjt induces a law of motion for capital
µ ∙ ¸¶
xjt
kjt = (1 − δ) kjt−1 + μt 1 − S xjt
xjt−1
where δ is the depreciation rate and S [·] is an adjustment cost function such that S [Λx ] = 0,
S 0 [Λx ] = 0, and S 00 [·] > 0 where Λx is the growth rate of investment along the balance
growth path. We will determine that growth rate below. Note our capital timing: we index
capital by the time its level is decided. The investment-specific technological shock follows
an autoregressive process:
μt = μt−1 exp (Λμ + zμ,t ) where zμ,t = σ μ εμ,t and εμ,t ∼ N (0, 1)
The value of μt is also the inverse of the relative price of new capital in consumption terms.
Given our description of the household’s problem, the lagrangian function associated with
it is:
⎡ ½ ³ ´ 1+γ
¾ ⎤
mjt ljt
⎢ dt log (cjt − hcjt−1 ) + υ log pt − ϕt ψ 1+γ ⎥
X ⎢
∞ ⎢ ( R ) ⎥
mjt bjt
cjt + xjt + pt + pt + qjt+1,t ajt+1 dω j,t+1,t ⎥
E0 βt ⎢
⎢ −λjt ¡ ¢
⎥
⎥
mjt−1 bjt−1
t=0 ⎢ −w jt ljt − rt u jt − μ−1
a [ujt ] kjt−1 − − R t−1 − a jt − Tt − zt ⎥
⎣ n t ³pt h i´
pt o ⎦
xjt
−Qjt kjt − (1 − δ) kjt−1 − μt 1 − S xjt−1 xjt
where they maximize over cjt , bjt , ujt , kjt , xjt , wjt , ljt and ajt+1 (maximization with respect to
3
money holdings comes from the budget constraint), λjt is the lagrangian multiplier associated
with the budget constraint and Qjt the lagrangian multiplier associated with installed capital.
The first order conditions with respect to cjt , bjt , ujt , kjt , and xjt are:
We do not take first order conditions with respect to Arrow-Debreau securities since, in our
environment with complete markets and separable utility in labor, their equilibrium price
will be such that their demand ensures that consumption does not depend on idiosyncractic
shocks (see Erceg et. al., 2000).
Q
If we define the (marginal) Tobin’s Q as qjt = λjtjt , (the ratio of the two lagrangian
multipliers, or more loosely the value of installed capital in terms of its replacement cost) we
get:
The last equation is important. If S [·] = 0 (i.e., there are no adjustment costs), we get:
1
qjt =
μt
i.e., the marginal Tobin’s Q is equal to the replacement cost of capital (the relative price of
capital). Furthermore, if μt = 1, as in the standard neoclassical growth model, qjt = 1.
The first order condition with respect to labor and wages is more involved. The labor
used by intermediate good producers to be described below is supplied by a representative,
4
competitive firm that hires the labor supplied by each household j. The labor supplier
aggregates the differentiated labor of households with the following production function:
µZ 1 η−1
¶ η−1
η
ltd = η
ljt dj (1)
0
where 0 ≤ η < ∞ is the elasticity of substitution among different types of labor and ltd is the
aggregate labor demand.1
The labor “packer” maximizes profits subject to the production function (1), taking as
given all differentiated labor wages wjt and the wage wt . Consequently, its maximization
problem is: Z 1
max wt ltd − wjt ljt dj
ljt 0
Dividing the first order conditions for two types of labor i and j, we get:
µ ¶− η1
wit lit
=
wjt ljt
or: µ ¶ η1
lit
wjt = wit
ljt
Hence: η−1
1
wjt ljt = wit litη ljtη
R1
Now, by the zero profits condition implied by perfect competition wt ltd = 0
wjt ljt dj, we get:
1 ¡ ¢ η−1 1 ¡ ¢ 1
−
wt ltd = wit litη ltd η ⇒ wt = wit litη ltd η
1
Often, papers write θ = η−1 1 η
η and θ = η−1 . For that reparametrization, −∞ < θ ≤ 1, where as θ → −∞
(i.e., as η → 0), we go to a Leontieff production function, θ = 0 (i.e., η = 1) , we have a Cobb-Douglas, and
θ = 1 (i.e., η → ∞), a linear production function.
5
and, consequently, the input demand functions associated with this problem are:
µ ¶−η
wjt
ljt = ltd ∀j (2)
wt
This functional form shows the effect of elasticity η, on the demand for j − th type of labor.
R1
To find the aggregate wage, we use again the zero profit condition wt ltd = 0 wjt ljt dj and
plug-in the input demand functions:
Z 1 µ ¶−η Z 1
wjt
wt ltd = wjt ltd dj ⇒ wt1−η = 1−η
wjt dj
0 wt 0
to deliver:
µZ 1 ¶ 1−η
1
1−η
wt = wjt dj .
0
Idiosyncratic risks come about because households set their wages following a Calvo’s
setting. In each period, a fraction 1 − θw of households can change their wages. All other
households can only partially index their wages by past inflation. Indexation is controlled by
the parameter χw ∈ [0, 1]. This implies that if the household cannot change her wage for τ
Yτ χw
Πt+s−1
periods her normalized wage after τ periods is Πt+s
wjt .
s=1
Therefore, the relevant part of the lagrangian for the household is then:
( )
X
∞ 1+γ
ljt+τ Yτ χw
Πt+s−1
max Et (βθw )τ −dt ϕt ψ + λjt+τ wjt ljt+τ
wjt
τ =0
1+γ s=1
Πt+s
subject to à τ !−η
Y Πχt+s−1
w
wjt d
ljt+τ = lt+τ ∀j
s=1
Πt+s wt+τ
6
which simplifies to
⎧ Ã τ !1−η ⎫
⎪
⎪ Y Πχw ⎪
⎪
⎪
⎪ λjt+τ t+s−1 wjt d
wt+τ lt+τ ⎪
⎪
X
∞ ⎪
⎨ Πt+s wt+τ ⎪
⎬
s=1
max Et (βθw )τ ⎛ τ
Y Πχw w ⎞−η(1+γ)
wjt ⎪
⎪ ⎪
⎪
τ =0 ⎪
⎪ ⎝ t+s−1 jt ⎠
⎪
⎪
⎪
⎩ −d ϕ ψ s=1
Πt+s wt+τ
¡ d ¢1+γ ⎪
⎭
t+τ t+τ 1+γ
lt+τ
All households set the same wage because complete markets allow them to hedge the risk
of the timing of wage change. Hence, we can drop the jth from the choice of wages and λjt .
The first order condition of this problem is:
⎧ Ã τ !1−η ⎫
⎪ Y Πχw ³ ´−η ⎪
⎪
⎪ t+s−1 wt∗ d ⎪
⎪
⎪
⎨ (1 − η) λt+τ lt+τ ⎪
⎬
X
∞ Πt+s wt+τ
Et (βθw )τ Ã s=1 !−η(1+γ) =0
⎪
⎪ Y τ χw ¡ d ¢1+γ ⎪
⎪
τ =0 ⎪
⎪ η Π ∗
t+s−1 wt ⎪
⎪
⎩ + wt∗ dt+τ ϕt+τ ψ Πt+s wt+τ
lt+τ ⎭
s=1
or
à τ !1−η µ ¶−η
η−1 ∗ X Y Πχt+s−1
∞
τ
w
wt∗ d
wt Et (βθw ) λt+τ lt+τ =
η τ =0 s=1
Π t+s w t+τ
⎛ Ã τ !−η(1+γ) ⎞
X∞ Y χw
Πt+s−1 wt ∗ ¡ ¢ 1+γ
Et (βθw )τ ⎝dt+τ ϕt+τ ψ d
lt+τ ⎠
τ =0 s=1
Πt+s wt+τ
Now, if we define:
à τ !1−η µ ¶η
η−1 ∗ X Y Πχt+s−1
∞ w
wt+τ
ft1 = wt Et (βθw )τ λt+τ d
lt+τ
η τ =0 s=1
Πt+s wt∗
and à τ !−η(1+γ) µ
X
∞ Y Πχt+s ¶η(1+γ)
τ
w
wt+τ ¡ d ¢1+γ
ft2 = Et (βθw ) dt+τ ϕt+τ ψ lt+τ
τ =0 s=1
Πt+s−1 wt∗
we have that the equality ft1 = ft2 is just the previous first order condition. Note that for
those sums to be well defined (and, more generally for the maximization problem to have a
à τ !1−η
Y χw
solution), we need to assume that (βθw )τ λt+τ goes to zero faster than Πt+s /Πt+s−1
s=1
goes to infinity in expectation.
7
One can express ft1 and ft2 recursively as:
µ χ ¶1−η µ ∗
¶η−1
η − 1 ∗ 1−η Πt w wt+1
ft1 = (wt ) λt wtη ltd + βθw Et 1
ft+1
η Πt+1 wt∗
8
and: µ ¶η(1+γ) µ ¶−η(1+γ) µ ¶η(1+γ)
χ
wt ¡ d ¢1+γ Πt w ∗
wt+1
ft = ψdt ϕt lt + βθw Et ft+1 .
wt∗ Πt+1 wt∗
We need both laws of motion to be able, later, to solve for all the relevant endogenous
variables.
R1
Note that using the zero profits condition for the labor supplier, wt ltd = 0 wjt ljt dj and
the net zero supply of all securities, we have that the aggregate budget constraint can be
written as:
R1 R1
0
mjt dj bjt+1 dj
ct + xt + + 0 =
pt pt
R1 R1
¡ ¢ mjt−1 dj bjt dj
wt ltd + rt ut − μ−1
t a [ut ] kt−1 +
0
+ Rt−1 0 + Tt + zt
pt pt
wt1−η = θw 1−η
wt−1 + (1 − θw ) wt∗1−η .
Πt
i.e., as a geometric average of past real wage and the new optimal wage. This structure is a
direct consequence of the memoryless characteristic of Calvo pricing.
There is one final good is produced using intermediate goods with the following production
function: µZ 1 ¶ ε−1
ε
ε−1
ytd = yit ε di . (3)
0
Following the same steps than for the wages, we find the input demand functions associ-
9
ated with this problem are: µ ¶−ε
pit
yit = ytd ∀i,
pt
R1
where ytd is the aggregate demand and the zero profit condition pt ytd = 0
pit yit di to deliver:
µZ 1 ¶ 1−ε
1
pt = p1−ε
it di .
0
α
¡ d ¢1−α
yit = At kit−1 lit − φzt
where kit−1 is the capital rented by the firm, litd is the amount of the “packed” labor input
rented by the firm, and where At follows the following process:
At = At−1 exp (ΛA + zA,t ) where zA,t = σ A εA,t and εA,t ∼ N (0, 1)
1 α
The parameter φ, which corresponds to the fixed cost of production, and zt = At1−α μt1−α
guarantee that economic profits are roughly equal to zero in the steady state. We rule out
the entry and exit of intermediate good producers.
1 α
Since zt = At1−α μt1−α , we have that
Intermediate goods producers solve a two-stages problem. In the first stage, taken the
input prices wt and rt as given, firms rent litd and kit−1 in perfectly competitive factor markets
in order to minimize real cost:
min wt litd + rt kit−1
d ,k
lit it−1
10
Assuming an interior solution, the first order conditions for this problem are:
α
¡ d ¢−α
wt = % (1 − α) At kit−1 lit
¡
α−1 d
¢1−α
rt = %αAt kit−1 lit
α wt d
kit−1 = l
1 − α rt it
11
The problem of the firms is then:
(Ã τ ! )
X
∞
λt+τ Y pit
max Et (βθp )τ Πχt+s−1 − mct+τ yit+τ
pit
τ =0
λt s=1
pt+τ
subject to à τ !−ε
Y pit
yit+τ = Πχt+s−1 d
yt+τ ,
s=1
pt+τ
where the marginal value of a dollar to the household, is treated as exogenous by the firm.
Since we have complete markets in securities and utility separable in consumption, this mar-
ginal value is constant across households and, consequently, λt+τ /λt is the correct valuation
on future profits.
Substituting the demand curve in the objective function and the previous expression, we
get:
⎧⎛Ã !1−ε Ã τ !−ε ⎞ ⎫
X
∞
λt+τ ⎨ Y τ
pit Y pit ⎬
max Et (βθp )τ ⎝ Πχt+s−1 − Πχt+s−1 mct+τ ⎠ yt+τ
d
pit
τ =0
λt ⎩ s=1
pt+τ s=1
pt+τ ⎭
or
⎧⎛Ã !1−ε Ã τ !−ε ⎞ ⎫
X
∞
λt+τ ⎨ Y τ χ
Πt+s−1 pit Y χ
Πt+s−1 pit ⎬
max Et (βθp )τ ⎝ − mct+τ ⎠ yt+τ
d
pit
τ =0
λt ⎩ s=1
Πt+s pt s=1
Πt+s pt ⎭
or
⎧⎛ Ã τ !1−ε Ã τ !−ε ⎞ ⎫
X
∞ ⎨ Y Πt+s−1
χ ∗
pit Y Πt+s−1
χ ⎬
Et τ
(βθp ) λt+τ ⎝(1 − ε) +ε ⎠ d
mct+τ yt+τ = 0
τ =0
⎩ s=1
Πt+s pt s=1
Πt+s ⎭
where, in the second step, we have dropped irrelevant constants and we have used the fact
that we are in a symmetric equilibrium. Note how this expression nests the usual result in
the fully flexible prices case θp = 0:
ε
p∗it = pt mct+τ
ε−1
12
i.e., the price is equal to a mark-up over the nominal marginal cost.
Since we only consider a symmetric equilibrium, we can write that p∗it = p∗t and:
⎧⎛ Ã τ !1−ε Ã τ !−ε ⎞ ⎫
X
∞ ⎨ Y χ
Πt+s−1 ∗
pt Y χ
Πt+s−1 ⎬
Et (βθp )τ λt+τ ⎝(1 − ε) +ε mct+τ ⎠ yt+τ
d
=0
τ =0
⎩ s=1
Πt+s pt s=1
Πt+s ⎭
and à τ !1−ε
X
∞ Y Πχt+s−1
τ p∗t d
gt2 = Et (βθp ) λt+τ y
τ =0 s=1
Πt+s pt t+τ
and µ ¶1−ε µ ¶
Πχt Π∗t
gt2 = λt Π∗t ytd + βθp Et 2
gt+1
Πt+1 Π∗t+1
where:
p∗t
Π∗t = .
pt
Given Calvo’s pricing, the price index evolves:
¡ ¢1−ε 1−ε
p1−ε
t = θp Πχt−1 pt−1 + (1 − θp ) p∗1−ε
t
13
1.4. The Government Problem
The government sets the nominal interest rates according to the Taylor rule:
⎛ ⎛ yd ⎞γ y ⎞1−γ R
µ ¶γ R µ ¶γ Π t
Rt Rt−1 ⎝ Πt
d
⎝ yt−1 ⎠ ⎠
= exp (mt )
R R Π Λyd
through open market operations that are financed through lump-sum transfers Tt . Those
transfers insure that the deficit are equal to zero:
R1 R1 R1 R1
0
mjt dj 0
mjt−1 dj 0
bjt+1 dj 0
bjt dj
Tt = − + − Rt−1
pt pt pt pt
The variables Π represents the target level of inflation (equal to inflation in the steady state),
R steady state nominal gross return of capital, and Λyd the steady state gross growth rate of
ytd . The term mt is a random shock to monetary policy that follows mt = σ m εmt where εmt is
distributed according to N (0, 1). The presence of the previous period interest rate, Rt−1 , is
justified because we want to match the smooth profile of the interest rate over time observed
in U.S. data. Note that R is beyond the control of the monetary authority, since it is equal
to the steady state real gross returns of capital plus the target level of inflation.
Applying the definition of transfers above, the aggregated budget constraint of households
is equal to:
¡ ¢
ct + xt = wt ltd + rt ut − μ−1
t a [ut ] kt−1 + zt .
1.5. Aggregation
ytd = ct + xt + μ−1
t a [ut ] kt−1
With this value, the demand for each intermediate good producer is
µ ¶
¡ −1
¢ pit −ε
yit = ct + xt + μt a [ut ] kt−1 ∀i,
pt
14
Since all the firms have the same optimal capital-labor ratio:
kit−1 α wt
d
=
lit 1 − α rt
and Z 1
kit−1 di = ut kt−1 .
0
and we have
Z 1µ ¶−ε
¡ ¢1−α α ¡ ¢ pit
At (ut kt−1 ) ltd − φzt = ct + xt + μ−1
t a [ut ] kt−1 di
0 pt
R 1 ³ pit ´−ε
Define vtp = 0 pt
di. By the properties of the index under Calvo’s pricing
µ ¶−ε
Πχt−1
vtp = θp p
vt−1 + (1 − θp ) Π∗−ε
t .
Πt
we get: ¡ ¢1−α
At (ut kt−1 )α ltd − φzt
ct + xt + μ−1
t a [ut ] kt−1 = p
vt
Now, we derive an expression for aggregate labor demand. We know that
µ ¶−η
wjt
ljt = ltd
wt
15
If we integrate over all households j, we get
Z 1 Z 1µ ¶−η
wjt
ljt dj = lt = djltd
0 0 wt
2. Equilibrium
A definition of equilibrium in this economy is standard and the symmetric equilibrium policy
functions are determined by the following equations:
16
• The firms that can change prices set them to satisfy:
¶−ε µ
Πχt
gt1
= λt mct ytd
+ βθp Et 1
gt+1
Πt+1
µ χ ¶1−ε µ ∗ ¶
2 ∗ d Πt Πt 2
gt = λt Πt yt + βθp Et ∗
gt+1
Πt+1 Πt+1
εgt1 = (ε − 1)gt2
ut kt−1 α wt
d
=
lt 1 − α rt
µ ¶1−α µ ¶α 1−α α
1 1 wt rt
mct =
1−α α At
• Markets clear:
¡ ¢1−α
At (ut kt−1 )α ltd − φzt
ytd = p
vt
ytd −1
= ct + xt + μt a [ut ] kt−1
17
where
lt = vtw ltd
µ χ ¶−ε
p Πt−1 p
vt = θp vt−1 + (1 − θp ) Π∗−ε
t
Πt
µ χw ¶−η
w wt−1 Πt−1 w −η
vt = θw vt−1 + (1 − θw ) (Π∗w
t )
wt Πt
and µ ∙ ¸¶
xt
kt − (1 − δ) kt−1 − μt 1 − S xt = 0.
xt−1
3. Stationary Equilibrium
Since we have growth in this model induced by technological change, most of the variables
are growing in average. To solve the model, we need to make variables stationary.
18
The firms that can change prices set them to satisfy:
µ χ ¶−ε
ytd Πt
gt1
= λt zt mct + βθp Et 1
gt+1
zt Πt+1
d
µ χ ¶1−ε µ ∗ ¶
2 ∗ yt Πt Πt 2
gt = λt zt Πt + βθp Et ∗
gt+1
zt Πt+1 Πt+1
εgt1 = (ε − 1)gt2
ut kt−1 α wt 1 zt μt
d z
=
lt t−1 μt−1 1 − α zt rt μt zt−1 μt−1
³ ´1−α
µ ¶1−α µ ¶α wt zt1−α
1 1 zt
(rt μt )α μα
t
mct =
1−α α At
Markets clear: ³ ´α ¡ ¢
α At kt−1 1−α
ytd μαt−1 zt−1 zt
ut zt−1 μ ltd −φ
t−1
=
zt vtp
zt−1
but since μαt−1 zt−1
α
= At−1
, we have
³ ´α ¡ ¢
zt−1 At kt−1 1−α
ytd At−1 zt
ut zt−1 μ ltd −φ
t−1
=
zt vtp
19
ytd ct xt zt−1 μt−1 kt−1
= + + a [ut ]
zt zt zt zt μt zt−1 μt−1
where
lt = vtw ltd
µ χ ¶−ε
p Πt−1 p
vt = θp vt−1 + (1 − θp ) Π∗−ε
t
Πt
à wt−1 χw
!−η
w
z
zt−1 t−1 Πt−1 w −η
vt = θw wt vt−1 + (1 − θw ) (Π∗w
t )
z
zt t
Πt
and à " #!
xt
kt zt μt kt−1 μ zt z
zt t xt
− (1 − δ) − t 1−S xt−1 = 0.
zt μt zt−1 μt−1 zt−1 μt−1 μt−1 zt−1 z
zt−1 t−1
zt
We now redefine that variables to obtain a system on stationary variables that we can easily
manipulate. Hence, we define e et = λt zt , ret = rt μt , qet = qt μt , x
ct = zctt , λ et = xztt , w
et = wztt ,
∗ d
e∗ = wt , e
wt zt
kt = kt , and yed = yt .
zt μt t zt
Then, the set of equilibrium conditions are:
20
• The firms that can change prices set them to satisfy:
µ χ ¶−ε
e Πt
gt1 d
= λt mct yet + βθp Et 1
gt+1
Πt+1
µ χ ¶1−ε µ ∗ ¶
2 et Π ye + βθp Et Πt
gt = λ ∗ d Πt 2
gt+1
t t ∗
Πt+1 Πt+1
εgt1 = (ε − 1)gt2
ut e
kt−1 α w et zt μt
d
=
lt 1 − α ret zt−1 μt−1
µ ¶1−α µ ¶α
1 1
mct = et )1−α retα
(w
1−α α
• Markets clear:
zt−1 μt−1
yetd = e
ct + xet + a [ut ] e
kt−1
zt μt
³ ´α ¡ ¢
At zt−1 e 1−α
A t−1 zt
u t kt−1 ltd −φ
yetd =
vtp
21
where
lt = vtw ltd
µ χ ¶−ε
p Πt−1 p
vt = θp vt−1 + (1 − θp ) Π∗−ε
t
Πt
µ χw ¶−η
w et−1 zt−1 Πt−1
w w −η
vt = θw vt−1 + (1 − θw ) (Π∗w
t )
et zt Πt
w
and µ ∙ ¸¶
e zt μt zt μt et zt
x
kt − (1 − δ) e
kt−1 − 1−S et = 0.
x
zt−1 μt−1 zt−1 μt−1 et−1 zt−1
x
We will solve the model by loglinearizing the equilibrium conditions and applying standard
techniques. Before loglinearizing, we need to find the steady-state of the model. We will solve
the normalized model defined in the last section. Note that later, when we bring the model
to the data, we will need to undo the normalization.
Now, we will find the deterministic steady-state of the model. First, let ze = exp (Λz ),
μ e = exp (ΛA ). Also, given the definition of e
e = exp (Λμ ), and A et , w
c, x et∗ , and yetd , we have
et , w
that Λc = Λx = Λw = Λw∗ = Λyd = Λz .
Then, in steady-state, the first order conditions of the household can be written as:
1 1 e
d h
− hβd =λ
e
c − ze e
c ecze − he c
1R
1=β
ze Π
0
re = a [1]
1
qe = β ((1 − δ) qe + reu − a [1])
zeμ
e
qe
1 = qe (1 − S [e z ] − S 0 [ez ] ze) + β S 0 [e
z ] ze2
ze
µ χ ¶1−η
η − 1 ∗ 1−η e η d Π w
f= e ) λw
(w e l + βθw zeη−1 f
η Π
µ χ ¶−η(1+γ)
¡ w∗ ¢−η(1+γ) ¡ d ¢1+γ Π w
f = ψdϕ Π l + βθw zeη(1+γ) f
Π
22
the first order conditions of the firm as:
¶
χ −ε
µ
e y + βθp
1 Π
d
g = λmce g1
Π
µ χ ¶1−ε
2 e ∗ d Π
g = λΠ ye + βθp g2
Π
εg1 = (ε − 1)g 2
uek α w e
= zeμ
e
ld 1 − α re
µ ¶1−α µ ¶α
1 1
mc = e1−α reα
w
1−α α
e
c+x e = yed
A
v p yed = (ue k)α (ld )1−α − φ
z
l = v w ld
µ χ ¶−ε
p Π
v = θp vp + (1 − θp ) Π∗−ε
Π
µ χ ¶−η
w Π w ∗
v = θw zeη v w + (1 − θw ) (Πw )−η
Π
e
ke
zμe − (1 − δ) ek − zeμ e (1 − S [z]) x
e = 0.
To find the steady-state, we need to choose functional forms for a [·] and S [·]. For a [u] we
pick: a [u] = γ 1 (u − 1)+ γ22 (u−1)2 . Since in the steady state weh havei u = 1, then re = a0 [1] =
γ 1 and a [1] = 0. The investment adjustment cost function is S xxt−1 t
= κ2 ( xxt−1
t
− Λx )2 . Then,
along the balanced growth path, S [Λx ] = S 0 [Λx ] = 0. Using this two expressions, we can
23
rearrange the system of equations that determine the steady-state as:
1 1 e
(1 − hβe
z) =λ
1 − hze e
c
Πe
z
R=
β
re = γ 1
µ ¶
β β
re = 1 − (1 − δ) /
zeμ
e zeμ
e
¡ ¢ η − 1 ∗ e w∗ −η d
1 − βθw ze(η−1) Π−(1−χw )(1−η) f = w λ(Π ) l
η
¡ ¢ ¡ ∗ ¢−η(1+γ) ¡ d ¢1+γ
1 − βθw zeη(1+γ) Πη(1−χw )(1+γ) f = ψ Πw l
¡ ¢
1 − βθp Π(1−χ)ε g1 = λmcee yd
¡ ¢
1 − βθp Π−(1−χ)(1−ε) g2 = λΠ e ∗ yed
εg1 = (ε − 1)g 2
e
k α w e
= zeμ
e
l d 1 − α re
µ ¶1−α µ ¶α
1 1
mc = e1−α reα
w
1−α α
1 − θw Π−(1−χw )(1−η) ze−(1−η) ¡ w∗ ¢1−η
= Π
1 − θw
1 − θp Π−(1−χ)(1−ε)
= Π∗1−ε
1 − θp
e
c+x e = yed
A e
vp yed = (e k)α (ld )1−α − φ
ze
l = v w ld
1 − θp Π(1−χ)ε p
v = Π∗−ε
1 − θp
¡ ¢
1 − θw zeη Π(1−χw )η w ∗
v = (Πw )−η
1 − θw
e zeμe
k= e.
x
zeμ
e − (1 − δ)
β
1− zeμ
e
(1 − δ)
r̃ = β
= γ1
zeμ
e
24
and that the nominal interest rate is:
Πe
z
R=
β
The relationship between inflation and optimal relative prices is:
µ ¶ 1−ε
1
∗ 1 − θp Π−(1−ε)(1−χ)
Π =
1 − θp
From the optimal price setting equations, we get that the marginal cost is:
ε − 1 1 − βθp Π(1−χ)ε
mc = Π∗
ε 1 − βθp Π−(1−χ)(1−ε)
e = (1 − α) mc
w
re
and the optimal wage evolves:
∗
e∗ = wΠ
w e w
We have the two following equations for the wage household decision:
¡ ¢ η − 1 ∗ ¡ w∗ ¢−η e d
1 − βθw zeη−1 Π−(1−χw )(1−η) f = w Π λl
η
and
¡ ¢ ¡ ∗ ¢−η(1+γ) ¡ d ¢1+γ
1 − βθw zeη(1+γ) Πη(1−χw )(1+γ) f = ψ Πw l .
25
Dividing the second by the first delivers:
¡ ∗ ¢−ηγ ¡ d ¢γ
1 − βθw zeη(1+γ) Πη(1−χw )(1+γ) ψ Πw l
= η−1
1 − βθw ze(η−1) Π−(1−χw )(1−η) η
w∗ λ̃
1 − θp
vp = Π∗−ε
1 − θp Π(1−χ)ε
where no price inflation or full price indexation delivers no price dispersion in steady-state.
Using the expression for Πw∗ we find that the wage dispersion in steady-state is:
1 − θw ∗
vw = (Πw )−η
1 − θw Π(1−χ )η
w z eη
where no price inflation or full wage indexation combine with zero growth delivers no wage
dispersion in in steady-state.
The relationship between labor demand and labor supply is:
l = v w ld .
Ae e α d 1−α
zeμ
e − (1 − δ) e ze
(k) (l ) −φ
e
c+ k = yed =
zeμ
e vp
26
that allows us to find e
k as function of ld :
e
k α w e
=Ω= e⇒e
zeμ k = Ωld .
l d 1 − α re
Then:
Ae α d
ze
Ω l −φ zeμ
e − (1 − δ) d
e
c = − Ωl
vp zeμ
e
à !
Ae e
z e
μ − (1 − δ)
= (vp )−1 Ωα − Ω ld − (v p )−1 φ
ze zeμ
e
Now, we can express the marginal utility of consumption in terms of hours, and get another
e
relationship between ld as a function of λ:
µ ¶−1 ÃÃ e ! !−1
h A p −1 α zeμ e − (1 − δ) e
(1 − hβ)de
z 1− (v ) Ω − Ω ld − (v p )−1 φ =λ
ze ze zeμ
e
Note that this is nonlinear equation. Therefore we will use a root finder to find ld .
Once we have ld , we can solve for capital, investment, output, and consumption as follows:
e
k = Ωld
zeμe − (1 − δ) e
e =
x k
zeμ
e
Ae e α d 1−α
d ze
(k) (l ) −φ
ye =
à vp !
Ae e
z e
μ − (1 − δ)
e
c = (v p )−1 Ωα − Ω ld − (vp )−1 φ
ze zeμ
e
27
We start by log linearizing the marginal utility of consumption:
µ ¶−1 µ ¶−1
zt−1 zt+1 et .
dt e
ct − he
ct−1 − hβEt dt+1 e
ct+1 − he
ct =λ (4)
zt zt
³ ´−1
zt−1
It is helpful to define the auxiliary variable auxt = dt e
ct − he
ct−1 zt . Then, we have that:
et
auxt − hβEt zet+1 auxt+1 = λ
b b
e
dt
aux expaux d t+1 +zet+1
−hβzauxEt expaux e λt
= λe
Using the following two steady state relationship that aux(1 − hβe e and that Etb
z) = λ zet+1 = 0,
we can write:
b
et .
ad
uxt − hβzEt ad uxt+1 = (1 − hβz) λ
28
that simplifies to:
õ ¶−1 µ ¶−1 ³ !
h h h ´
auxt = aux dbt − 1 −
auxd b
e
ct + 1 − ct−1 − b
b
e zet
ze ze ze
µ ¶−1 Ã b b
!
h b he
c h e
z
uxt = dbt − 1 −
t−1 t
ad e
ct − + . (6)
ze ze ze
b
et =
(1 − hβz)λ
µ ¶−1 Ã ! ( µ ¶−1 Ã !)
h b hb
e
ct−1 hbzet h b h b
e
c hb
ze
dbt − 1 − − hβzEt dbt+1 − 1 −
t t+1
e
ct − + e
ct+1 − + .
ze ze ze ze ze ze
This expression helps to understand the role of the habit persistence parameter h. If we set
h = 0 (i.e., no habit), we would get:
b
et = dbt − b
λ e
ct
et+1 zt Rt }.
et = βEt {λ
λ
zt+1 Πt+1
Rt b
e λet+1 1 Re }
b b
e λe = βEt {λe
λe
zeezz,t ΠeΠb t+1
29
Now, it is easy to show that:
b b
et = Et {λ
et+1 + R
bt − Π
b t+1 }.
λ (9)
First, we write:
b £ ¤
reeret = a0 u expubt ,
reb
ret = a00 [u] ub
ut .
Loglinearization delivers:
µ ¶
β b
qeb
qet = e b
Et 4λt+1 − zet+1 − μ b
et+1 ((1 − δ) qe + reu − a [u])
zeμ
e
β ³ ³ ´ ´
+ qet+1 + reu b
Et (1 − δ) qeb ret+1 + u
bt+1 − a [u] ubut+1 .
zeμ
e
30
³ ´
and 1 = β
zeμ
e
re + zeβμe (1 − δ), and Et −b b
et+1 = 0, the previous expression simplifies to:
zet+1 − μ
b β et+1 + β (1 − δ) Etb
b
qet = ((1 − δ) + re) Et ∆λ
β
qet+1 + reuEtb
ret+1 ,
zeμ
e zeμ
e zeμ
e
that implies: µ ¶
b b β (1 − δ) b β(1 − δ)
e
qet = Et ∆λt+1 + Et qet+1 + 1 − Etb
ret+1 . (11)
zeμ
e zeμ
e
The next equation to loglinearize is:
µ ∙ ¸ ∙ ¸ ¶ et+1 zt ∙ ¸µ ¶2
et zt
x 0 et zt
x et zt
x λ 0 xet+1 zt+1 et+1 zt+1
x
1 = qet 1 − S −S +βEt qet+1 S
et−1 zt−1
x et−1 zt−1 x
x et−1 zt−1 et zt+1
λ et zt
x et zt
x
³ h i h i ´
b
qet b
∆xet +b
zet 0 ∆xb
et +b
zet b
et +b
∆x zet
1 = qe exp 1 − S ze exp − S ze exp ze exp +
q̃ b h i b b
b b e b b
+β Et expqet −zet+1 +4λt+1 S ze exp∆xet+1 +zet+1 ze2 exp2(∆xet+1 +zet+1 ) .
00
ze
Taking the loglinear approximation (and using the fact that qe = 1) we get:
³ ´ β 00 ³ ´
b 00
0 = qet − S [e 2
z ] ze ∆x b b
et + zet + S [e 3 b b
et+1 + zet+1 .
z ] ze Et ∆x
z
Reorganizing:
³ ´
z 2 ∆b
κe x zet = b
et + b z 2 Et ∆b
qet + βκe et+1
x (12)
and
µ χ ¶−η(1+γ) µ ¶η(1+γ)
−η(1+γ) ¡ d ¢1+γ Πt w w ∗
et+1 zt+1
ft = ψdt ϕt (Π∗w
t ) lt + βθw Et ft+1 .
Πt+1 et∗ zt
w
31
The first equation can be written as:
b η − 1 ∗ 1−η e η d b∗ b e b bd
f expft = e ) λw
(w e l exp(1−η)wet +λt +ηwet +lt +
η
b b b b∗ b
βθ Π−(1−η)(1−χw ) zeη−1 f E expft −(1−η)(Πt+1 −χw Πt +∆wet+1 +zet+1 ) .
w t
Since Etb
zet+1 = 0, we can loglinearize the previous expression as:
µ ¶
η − 1 ∗ b
be + λ bet + b
f fbt = (w ∗ 1−η
e) λ ew η d
e l (1 − η) w t
et + η w d
lt +
η
³ ³ ∗
´´
βθw Π −(1−η)(1−χw ) η−1 b b b b
ze f Et ft+1 − (1 − η) (Πt+1 − χw Πt ) + ∆w
et+1 .
η−1 −(1−η)(1−χw )
η−1
η
(w∗ )1−η λwη ld
1 − βθw ze Π = ,
f
Let us know consider the second equation describing the behavior of f . First we can write it
as:
b b b b∗ bd
f expft = ψdϕ(ld )1+γ expdt +bϕt +η(1+γ)(wet −wet )+(1+γ)lt +
b b b b∗ b
+βθ zeη(1+γ) Πη(1+γ)(1−χw ) f E expft+1 +η(1+γ)(Πt+1 −χw Πt +∆wet+1 +zet+1 ) .
w t
32
Let us loglinearize the law of motion for gt1 and gt2 . First consider
µ ¶−ε
et mct yed + βθp Et Πχt
gt1 =λ t
1
gt+1
Πt+1
e yd
λmce
1 − βθp Πε(1−χ) =
g1
therefore,
µ ¶ ³ ´
¡ ¢ b d
gt1
b = 1 − βθp Πε(1−χ)
λet + mc b ε(1−χ)
c t + yet + βθp Πt b t+1 − χΠ
Et ε(Π b t ) + gbt+1
1
. (15)
33
therefore:
µ ¶
¡ ¢ b d
gt2
b = 1 − βθp Π−(1−ε)(1−χ) e b ∗ b
λt + Πt + yet
³ ³ ´ ³ ´ ´
+βθp Π−(1−ε)(1−χ) Et −(1 − ε) Π b t+1 − χΠ
bt − Πb ∗t+1 − Π
b ∗t + b2
gt+1 . (16)
gbt1 = b
gt2 . (17)
Now, let us loglinearize the relationship between the capital-labor ratio and the real wage-
real interest rate
ut e
kt−1 α w et zt μt
d
= .
lt 1 − α ret zt−1 μt−1
It is easy to show that
b bet − b
u k t−1 − b
bt + e ltd = w ret + b b
zet + μ
et . (18)
to get
mc bet + αb
c t = (1 − α)w ret . (19)
b b bw ∗ b w∗
1 = θw Π−(1−χw )(1−η) ze−(1−η) exp−(1−η)(Πt −χw Πt−1 +Πt +ezt ) + (1 − θw ) (Πw )1−η exp(1−η)Πt ,
34
that we can write as:
b b b∗
1 = θp Π−(1−ε)(1−χ) exp−(1−ε)(Πt −χΠt−1 ) + (1 − θp ) (Π∗ )(1−ε) exp(1−ε)Πt
lt = vtw ltd ,
a [ut ] e
kt−1
e et +
ct + x = yetd ,
et zet
μ
and
Aet ³ ´α ¡ ¢1−α
vtp yetd = e
ut kt−1 ltd −φ
zet
can be written as:
b w bd
l explt = vw ld expvbt +lt ,
h i b
b
et e
u e
kt−1
be b
a ue exp k exp b d
ct et
x d yet
e
c exp +e x exp + = e
y exp ,
e expμeb t +bzet
zeμ
and µ ¶
d Ae ³ ´α ³ ´1−α A
be b
et +α
t −z u
b
kt−1 +(1−α)e
bt +e ltd
btp +b
v p yed expv yet
= ue
k e
ld exp −φ
ze
et+1 =
respectively, where A At+1
.
At
35
Loglinearizing we get:
b vtw + b
lt = b ltd , (23)
γ ek d
ct + x̃b
c̃b
e et + 1 u
x bt = ỹ db
yet , (24)
zeμ
e
and
³ d
´ Ae ³ ´α ³ ´1−α µ b µ
b
¶ ¶
d p p b
(ỹ v ) vbt + yet = e
uk e
l d e b
At − zet + α u e ed
bt + kt−1 + (1 − α) lt . (25)
ze
p b b p b∗
v p expvbt = θp Πε(1−χ) v p expε(Πt −χΠt−1 )+bvt−1 + (1 − θp ) Π∗−ε expεΠt .
Using
¡ ¢
1 − θp Πε(1−χ) vp = (1 − θp ) Π∗−ε
we get: ³ ´ ¡ ¢ ∗
vbtp = θp Π ε(1−χ) b b p bt .
ε(Πt − χΠt−1 ) + vbt−1 − 1 − θp Πε(1−χ) εΠ (26)
w b b b b b w b∗ b
v w evbt = θw Πη(1−χw ) zeη v w eη(Πt −χw Πt−1 +wet −wet−1 +zet )+bvt−1 + (1 − θw ) (Πw∗ )−η e−η(wet −wet ) .
Using
¡ ¢
1 − θw Πη(1−χw ) zeη vw = (1 − θw ) (Πw∗ )−η
we get:
³ ³ ´ ´ ¡ ¢
vbtw = θw Πη(1−χw ) zeη η Πb t − χw Π bet − w
b t−1 + w bet−1 + b w
zet + vbt−1 be∗ −w
− 1 − θw Πη(1−χw ) zeη η(w bet ).
t
(27)
Finally, let us loglinearize the law of motion of capital
36
µ ∙ ¸¶
x̃t
k̃t zet μ
et = (1 − δ) k̃t−1 + μ
et zet 1 − S zet x̃t .
x̃t−1
If we rearrange terms, we get:
b̃ b̃
³ h i´
kt +b b
zet +μ
et b b
et
zet +μ b b
et
zet +4x b
k̃ee exp
zμ = (1 − δ) k̃ exp kt−1
+ee exp
zμ 1 − S ze x̃ expxet .
Loglinearizing:
³ ´
k̃ee b̃
zμ kt + b et = (1 − δ) k̃b̃
b
zet + μ ex̃(b
kt−1 + zeμ b
et + b
zet + μ et ).
x
zeμ
e
Note that, using k̃ = zeμ
e −(1−δ)
x̃, we can rearrange the previous expression to get:
b̃ (1 − δ) b̃ zeμ
e − (1 − δ) b b
kt + b b
zet + μ
et = kt−1 + et + b
(zet + μ et )
x
zeμ
e zeμ
e
or
b̃ (1 − δ) b̃ zeμ
e − (1 − δ) b 1 − δ ³b b ´
kt = kt−1 + et −
x zet + μ
et . (28)
zeμ
e zeμ
e zeμ
e
We now present the equations in the system as ordered in Uhlig algorithm model2fun.m
b t − χw a1 Π
a1 Π bet − a1 w
b t−1 + a1 w be∗ − w
bet−1 + a1 zet = w bet
t
and rearranging:
b t − χw a1 Π
a1 Π bet − a1 w
b t−1 + (1 + a1 )w be∗ = 0
bet−1 + a1 zet − w (29)
t
37
Equation 2 The second equation is:
θp Π−(1−ε)(1−χ) b b t−1 ) = Π
b ∗t
(Πt − χΠ
(1 − θp ) (Π∗ )(1−ε)
θp Π−(1−ε)(1−χ)
In order to make notation for compact, define a2 = (1−θp )(Π∗ )(1−ε)
. Note that in the file this
Π−(1−ε)(1−χ)
expression appears as a2 = (1−θ θ){exp[log(Π
p
∗ )]}(1−ε)
, because when we solve for the steady state
p
value Π∗ , we express it in log-levels. Substituting for a2 :
b t − χΠ
a2 (Π b t−1 ) = Π
b ∗t
Rearranging:
a2 Π b t−1 − Π
b t − a2 χΠ b ∗t = 0 (30)
where φu = γ 2 /γ 1 . Then,
−b
ret + φu ût = 0 (31)
Rearranging:
gbt1 − b
gt2 = 0 (32)
b bet − b
bt + e
u kt−1 − b
ltd = w ret + b b
zet + μ
et
Rearranging:
b
bt + b
u ret + e
kt−1 − b bet − b
ltd − w b
zet − μ
et (33)
mc bet + αb
c t = (1 − α)w ret
Rearranging:
bet + αb
(1 − α)w ret − mc
ct = 0 (34)
38
Equation 7 The seventh equation is:
³ d
´
bt = γ R R
R b t + γ y (4b
bt−1 + (1 − γ R ) γ Π Π yet + b
zet ) + m
bt
Rearranging:
d d
bt + γ R R
−R b t + (1 − γ R )γ y b
bt−1 + (1 − γ R )γ Π Π zet + (1 − γ R )γ y b
yet − (1 − γ R )γ y b b t = 0 (35)
yet−1 + m
γ ek d
ct + x̃b
c̃b
e et + 1 u
x bt = ỹ db
yet
zeμ
e
Note that in the code, because we have solved for the log-steady h ³ ´i state, constants enter
£ ¡ ¢¤
as follows: c̃ = exp [log (c̃)], x̃ = exp [log (x̃)] , k̃ = exp log k̃ , ỹ d = exp log ỹ d .
Rearranging:
γ ek d
ct + x̃b
c̃b
e et + 1 u
x bt − ỹ db
yet = 0 (36)
zeμ
e
³ d
´ Ae ³ ´α ³ ´1−α µ b µ
b
¶ ¶
d p p b
(ỹ v ) vbt + yet = e
uk e
l d e b
At − zet + α u e ed
bt + k t−1 + (1 − α) lt
ze
³ ´α ³ ´1−α
e
Define the parameter produc = Aze uek e
ld . Note that in terms of Uhlig notation, this
n h ioα n h io1−α
Ae e ed
is defined as produc = ze exp [log(u)] exp log(k) exp log(l ) . Also note that in
d
£ ¡ d ¢¤ p p
terms of the code, we have that ỹ = exp log ỹ , v = exp [log (v )]. Substituting:
³ ´ µ µ ¶ ¶
d b b
(ỹ v ) vbt + b
d p p
yet = produc Aet − b
zet + α u k t−1 + (1 − α) e
bt + e d
lt
Rearranging:
d be
vtp + (ỹ d vp )b
(ỹ d vp )b yet − (produc)A b
et − (α)(produc)b
t + (produc)z ut
b
−(α)(produc)e kt−1 − (1 − α) (produc)eltd = 0 (37)
39
Equation 10 The tenth equation is:
³ ´ ¡ ¢ ∗
b t − χΠ
vbtp = θp Πε(1−χ) ε(Π b t−1 ) + vbt−1
p bt
− 1 − θp Πε(1−χ) εΠ
Define a3 = βθp Πε(1−χ) . Then, θp Πε(1−χ) = aβ3 . This type of parameter definition will become
clearer when we analyze the price setting equations. Then, substituting:
µ ¶
a3 b a3 b a3 p a3 b ∗t
vbtp = εΠt − χε Πt−1 + vbt−1 − 1 − εΠ
β β β β
And rearranging:
µ ¶
a3 ε b a3 εχ b a3 p a3 b ∗t − vbtp = 0
Πt − Πt−1 + vbt−1 − 1 − εΠ (38)
β β β β
Rearranging:
∗
b t − χw ηa4 Π
vbtw = a4 η Π bet − a4 η w
b t−1 + a4 η w bet−1 + a4 ηb w
zet + a4 vbt−1 be + (1 − a4 ) η w
− (1 − a4 ) η w bet
t
Then,
b t − χw ηa4 Π
a4 η Π bet − a4 η w
b t−1 + η w bet−1 + a4 ηb w
zet + a4 vbt−1 be∗ − vbw = 0
− (1 − a4 ) η w (39)
t t
lt = vbtw + b
b ltd
b vtw − b
lt − b ltd = 0 (40)
40
Equation 13 The thirteenth equation is:
b̃ (1 − δ) b̃ zeμ
e − (1 − δ) b 1 − δ ³b b ´
kt = kt−1 + et −
x et
zet + μ
zeμ
e zeμ
e zeμ
e
be b
b A et
t + αμ
zet =
1−α
b 1 + b2 β b b βbz̃ b
(1 − bβe et = dbt − bβe
z )λ z Et dbt+1 − ¡ b
ct + ¡
¢e b
¢b
ct−1 + ¡
e b
¢ Etb
ct+1 − ¡
e ¢b
zet
1 − ze ze 1 − ze 1 − ze ze 1 − zeb
Rearranging:
1 + b2 β b b b βbz̃ b b b
dbt −bβe
z Et dbt+1 − ¡ b
¢ e
ct + ¡ b
¢ e
ct−1 + ¡ b
¢ Et e
ct+1 − ¡ b
¢b
zet −(1−bβe et = 0 (43)
z )λ
1 − ze ze 1 − ze 1 − ze ze 1 − ze
b b
et+1 + R
et = Et {λ bt − Π
b t+1 }
λ
41
which we rearrange to:
µ ¶
b b β (1 − δ) β(1 − δ)
et+1 − λ
Et λ et + Etb
qet+1 + 1 − ret+1 − b
Etb qet = 0 (45)
zeμ
e zeμ
e
b z 2 Et b
qet + βκe x z2b
et+1 − (1 + β)κe z2b
et + κe
x z 2b
et−1 − κe
x zet = 0 (46)
µ ¶
¡ ¢ ∗ b
fbt = η−1 −(1−η)(1−χw )
1 − βθw ze Π b e
et + λt + η w
(1 − η) w b bd
et + lt +
³ ³ ´´
βθw Π−(1−η)(1−χw ) zeη−1 Et fbt+1 − (1 − η) Π b t + ∆w
b t+1 − χw Π be∗
t+1
Rearranging:
b
be∗ + (1 − a5 ) λ bet + (1 − a5 ) b
et + (1 − a5 ) η w
(1 − η) w t ltd + a5 Et fbt+1
b t+1 − (η − 1)a5 χw Π
+(η − 1)a5 Et Π be∗ − fbt = 0
b t − (1 − η)a5 Et w (47)
t+1
42
Rearranging,
(1 − a6 ) dbt + (1 − a6 ) ϕ
b t + η (1 + γ) (1 − a6 ) w be∗ + (1 + γ) (1 − a6 ) b
bet − η (1 + γ) w ltd − fbt
t
∗
+a6 Et fbt+1 + a6 η (1 + γ) Et Π
b t+1 − a6 η (1 + γ) χw Π be = 0
b t + a6 η (1 + γ) Et w (48)
t+1
b d
(1 − a3 ) λ c t + (1 − a3 ) b
et + (1 − a3 ) mc b t+1 − χεa3 Π
yet + εa3 Et Π b t + a3 Et gbt+1
1
gt1 = 0
−b (49)
b b ∗t + (1 − a7 ) b
et + Π d
b t+1 − χ(ε − 1)a7 Π
b t − a7 Et Π
b ∗t+1 + a7 Et gbt+1
2
(1 − a7 ) λ yet + (ε − 1)a7 Et Π gt2 = 0
−b
Note that Uhlig does not allow to write something like dbt = ρdbt−1 + σ d εd,t . We declare the
variance-covariance matrix later. The following shocks are not defined because of their i.i.d.
nature.
μb
et = zμ,t
be
A t = zA,t
mt = σ m εm,t
43
4.4. Solving the Model
Now, let µ ¶0
bet , b b bt , b d b b
statet = Πb t, w 1
gt , e
gt , b2
kt, R yet , b
e vt , vbt , b
ct , bp w
qet , fet , b et , b
et , λ
x zet ,
³ ´0
nstatet = b
ret , u b ∗t , b
bt , Π c t, b
ltd , mc be∗ ,
lt , w t
³ ´0
exot = zμ,t , dbt , ϕ
b t , zA,t , mt ,
and
εt = (εμ,t , εd,t , εϕ,t , εA,t , εm,t )0 .
Then, we need to write the system defined above in Uhlig’s format, i.e.:
First, note that from this section on, and in the codes, we define the variables in terms of
their loglinear deviation from steady-state. The matrices in Uhlig’s notation are as following
44
⎛ ⎞
a1 1 + a1 0 0 0 0 0 0 0 0 0 0 0 0 a1
⎜ ⎟
⎜ a2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 1 −1 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 −1 0 0 0 0 0 0 0 0 0 0 0 0 −1 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 1−α 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ (1 − γ R )γ Π 0 0 0 0 −1 (1 − γ R )γ y 0 0 0 0 0 0 0 (1 − γ R )γ y ⎟
⎜ ⎟
AA = ⎜ ⎟
⎜ 0 0 0 0 0 0 −ỹ d c̃ 0 0 0 0 x̃ 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 ỹ d vp 0 ỹ d vp 0 0 0 0 0 produc ⎟
⎜ ⎟
⎜ ⎟
⎜ a3 ε/β 0 0 0 0 0 0 0 −1 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ηa4 η 0 0 0 0 0 0 0 −1 0 0 0 0 ηa4 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 −1 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 −1 0 0 0 0 0 0 0 1 − (1−δ) 0 (1−δ)
− z̃μ̃ ⎟
⎝ z̃μ̃ ⎠
0 0 0 0 0 0 0 0 0 0 0 0 0 0 −1
⎛ ⎞
−χw a1 −a1 0 0 0 0 0 0 0 0 0 0 0 0 0
⎜ ⎟
⎜ −χa2 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ 0 0 0 0 0 γ R −(1 − γ R )γ y 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
BB = ⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ 0 0 0 0 −α(produc) 0 0 0 0 0 0 0 0 0 ⎟ 0
⎜ ⎟
⎜ −a3 εχ ⎟
⎜ 0 0 0 0 0 0 0 a3
0 0 0 0 0 ⎟ 0
⎜ β β ⎟
⎜ −χ ηa −ηa 0 0 0 0 0 0 0 a4 0 0 0 0 0 ⎟
⎜ w 4 4 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 1−δ ⎟
⎝ 0 0 0 0 z̃μ̃
0 0 0 0 0 0 0 0 0 0 ⎠
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
45
⎛ ⎞
0 0 0 0 0 0 −1
⎜ ⎟
⎜ 0 0 −1 0 0 0 0 ⎟
⎜ ⎟
⎜ −1 φu 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 1 1 0 −1 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ α 0 0 0 −1 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎜ ⎟
CC = ⎜ γ 1 k̃ ⎟
⎜ 0 0 0 0 0 0 ⎟
⎜ z̃μ̃ ⎟
⎜ 0 −α(produc) 0 −(1 − α)(produc) 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 −(1 − a3
)ε 0 0 0 0 ⎟
⎜ β ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 −η(1 − a4 ) ⎟
⎜ ⎟
⎜ 0 0 0 −1 0 1 0 ⎟
⎜ ⎟
⎜ ⎟
⎝ 0 0 0 0 0 0 0 ⎠
0 0 0 0 0 0 0
⎛ ⎞
0 0 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ −1 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 1 ⎟
⎜ ⎟
DD = ⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 −produc 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ − 1−δ 0 0 0 0 ⎟
⎝ z̃μ̃ ⎠
α 1
1−α
0 0 1−α
0
46
⎛ βbz̃
⎞
0 0 0 0 0 0 0 1− z̃b
0 0 0 0 0 0 0
⎜ ⎟
⎜ −1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ⎟
⎜ ⎟
⎜ β(1−δ) ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 z̃μ̃
0 0 1 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 βκz̃ 2 0 0 ⎟
FF = ⎜
⎜
⎟
⎟
⎜ a5 (η − 1) 0 0 0 0 0 0 0 0 0 0 a5 0 0 0 ⎟
⎜ ⎟
⎜ a6 η(1 + γ) 0 0 0 0 0 0 0 0 0 0 a6 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎝ a3 ε 0 a3 0 0 0 0 0 0 0 0 0 0 0 0 ⎠
a7 (ε − 1) 0 0 a7 0 0 0 0 0 0 0 0 0 0 0
⎛ ⎞
0 0 0 0 0 0 0 GG1,8 0 0 0 0 0 −(1 − bβ z̃) GG1,15
⎜ ⎟
⎜ 0 0 0 0 0 1 0 0 0 0 0 0 0 −1 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 −1 0 0 −1 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 1 0 GG4,13 0 −κz̃ 2 ⎟
GG = ⎜
⎜
⎟
⎟
⎜ −a5 χw (η − 1) (1 − a5 )η 0 0 0 0 0 0 0 0 0 −1 0 1 − a5 0 ⎟
⎜ ⎟
⎜ −a6 χw η(1 + γ) GG6,2 0 0 0 0 0 0 0 0 0 −1 0 0 0 ⎟
⎜ ⎟
⎜ −a3 εχ 0 −1 0 0 0 1 − a3 0 0 0 0 0 0 1 − a3 0 ⎟
⎝ ⎠
−a7 (ε − 1)χ 0 0 −1 0 0 1 − a7 0 0 0 0 0 0 1 − a7 0
where
1 + βb2
GG1,8 = −
1 − z̃b
b
GG1,15 = −
z̃(1 − z̃b )
GG6,2 = (1 − a6 )η(1 + γ)
GG4,13 = −(1 + β)κz̃ 2
⎛ b
⎞
0 0 0 0 0 0 0 z̃(1− z̃b )
0 0 0 0 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 κz̃ 2 0 0 ⎟
HH = ⎜
⎜
⎟
⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎝ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ⎠
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
47
⎛ ⎞
0 0 0 0 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 1− β(1−δ)
0 0 0 0 0 0 ⎟
⎜ z̃μ̃ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
JJ = ⎜
⎜
⎟
⎜ 0 0 0 0 0 0 −a5 (1 − η) ⎟
⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 a6 η(1 + γ) ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎝ ⎠
0 0 −a7 0 0 0 0
⎛ ⎞
0 0 0 0 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 0 0 ⎟
KK = ⎜
⎜
⎟
⎟
⎜ 0 0 0 1 − a5 0 0 1−η ⎟
⎜ ⎟
⎜ 0 0 0 (1 − a6 )(1 + γ) 0 0 −η(1 + γ) ⎟
⎜ ⎟
⎜ 0 0 0 0 1 − a3 0 0 ⎟
⎝ ⎠
0 0 1 0 0 0 0
⎛ ⎞
0 −βbz̃ 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
LL = ⎜
⎜ 0
⎟
⎜ 0 0 0 0 ⎟ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎝ ⎠
0 0 0 0 0
⎛ ⎞
0 1 0 0 0
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
MM = ⎜
⎜ 0
⎟
⎟
⎜ 0 0 0 0 ⎟
⎜ ⎟
⎜ 0 1 − a6 1 − a6 0 0 ⎟
⎜ ⎟
⎜ 0 0 0 0 0 ⎟
⎝ ⎠
0 0 0 0 0
48
⎛ ⎞
0 0 0 0 0
⎜ ⎟
⎜ 0 ρd 0 0 0 ⎟
⎜ ⎟
NN = ⎜
⎜ 0 0 ρϕ 0 0 ⎟
⎟
⎜ ⎟
⎝ 0 0 0 0 0 ⎠
0 0 0 0 0
⎛ ⎞
σ 2μ 0 0 0 0
⎜ 2 ⎟
⎜ 0 σd 0 0 0 ⎟
⎜ ⎟
Σ=⎜
⎜ 0 0 σ 2ϕ 0 0 ⎟
⎟
⎜ 2 ⎟
⎝ 0 0 0 σA 0 ⎠
0 0 0 0 σ 2m
and
nstatet = RR ∗ statet−1 + SS ∗ exot .
We observe obst = (log Πt , log Rt , 4 log wt , 4 log yt )0 . Therefore, to write the likelihood
function, we need to write the model in the following state space form:
St = A ∗ St−1 + B ∗ εt
obst = C ∗ St−1 + D ∗ εt
Hence, ⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ 0 PP 0 QQ ∗ NN ⎥
A=⎢
⎢
⎥
⎥
⎣ 0 I 0 0 ⎦
0 0 0 NN
49
and ⎡ ⎤
0
⎢ ⎥
⎢ QQ ⎥
B=⎢
⎢
⎥ ∗ Σ1/2 .
⎥
⎣ 0 ⎦
I
Note that:
bet − w
w bet−1 = P P (2, :) ∗ statet−1 + QQ (2, :) ∗ exot − P P (2, :) ∗ statet−2 − QQ (2, :) ∗ exot−1 =
and
yet − b
b yet−1 = P P (7, :) ∗ statet−1 + QQ (7, :) ∗ exot − P P (7, :) ∗ statet−2 − QQ (7, :) ∗ exot−1 =
P P (7, :) ∗ statet−1 − P P (7, :) ∗ statet−2
+QQ (7, :) ∗ N N ∗ exot−1 − QQ (7, :) ∗ exot−1 + QQ (7, :) ∗ Σ1/2 ∗ εt ,
Also, remember that Π b t = log Πt − log Πss , R bt = log Rt − log Rss , wbet − w
bet−1 = 4 log wet =
4 log wt − 4 log zt , and byet − b αΛ +Λ
yet−1 = 4 log yet = 4 log yt − 4 log zt . Since 4 log zt = 1−α A +
μ
αzμ,t +zA,t
1−α
, we have:
obst = C ∗ St−1 + D ∗ εt .
50
where ⎡ ⎤
log Πss P P (1, :) 0 QQ (1, :) ∗ NN
⎢ ⎥
⎢ log Rss P P (6, :) 0 QQ (6, :) ∗ NN ⎥
C=⎢
⎢ αΛμ +ΛA P P (2, :) −P P (2, :) QQ (2, :) ∗ (NN − I)
⎥
⎥
⎣ 1−α ⎦
αΛμ +ΛA
1−α
P P (7, :) −P P (7, :) QQ (7, :) ∗ (NN − I)
and ⎡ ⎤
QQ (1, :)
⎢ ⎥
⎢ QQ (6, :) ⎥
⎢ µ ¶ ⎥
⎢ ⎥
D=⎢ α 0 0 1 0 ⎥ ∗ Σ1/2
⎢ QQ (2, :) + ⎥
⎢ µ 1−α ¶ ⎥
⎣ α 0 0 1 0 ⎦
QQ (7, :) + 1−α
51