Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Handout 15 DSGE Iris

Download as pdf or txt
Download as pdf or txt
You are on page 1of 61

Dynamic Stochastic General Equilibrium

Model

Randall Romero Aguilar, PhD

EC3201 - Teoría Macroeconómica 2


I Semestre 2019
Last updated: July 3, 2019
Table of contents

1. Introduction

2. Households

3. Firms

4. The competitive equilibrium

5. The central planning equilibrium

6. The steady state

7. IRIS
Introduction
Dynamic Stochastic General Equilibrium (DSGE) models

I DSGE models have become the fundamental tool in current


macroeconomic analysis
I They are in common use in academia and in central banks.
I Useful to analyze how economic agents respond to changes in
their environment, in a dynamic general equilibrium
micro-founded theoretical setting in which all endogenous
variables are determined simultaneously.
I Static models and partial equilibrium models have limited
value to study how the economy responds to a particular
shock.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 1


DSGE: microfoundations + rational expectations

I Modern macro analysis is increasingly concerned with the


construction, calibration and/or estimation, and simulation of
DSGE models.
I DSGE models start from micro-foundations, taking special
consideration of the rational expectation forward-looking
economic behavior of agents.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 2


Households
General assumptions about consumers

I There is a representative agent.


I Who is an optimizer: she maximizes a given objective
function.
I She lives forever: infinite horizon
I Her happiness depends on consumption C and leisure O.
I The maximization of her objective function is subject to a
resource restriction: the budget constraint.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 3


Instant utility

I The instant utility function is

u(C, O)

I She prefers more consumption and more leisure to less:

uC > 0 uO > 0

I Higher consumption (and leisure) implies greater utility but at


a decreasing rate:

uCC < 0 uOO < 0

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 4


Expected utility function

I The consumer’s happiness depends on the entire path of


consumption and leisure that she expects to enjoy:

U (C0 , C1 , . . . , C∞ , O0 , O1 , . . . , O∞ )

I She’s impatient: she discounts future utility by β.


I Her utility is time separable.
I Therefore, her expected utility is


E0 β t u(Ct , Ot )
t=0

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 5


Resource ownership

I To define a budget constraint we must introduce property


rights.
I Here,we assume that the consumer is the owner of production
factors: capital K and L labor.
I L comes from the available endowment of time, which we
normalize to 1. Because time cannot be accumulated, labor
decisions will be static.
I K is accumulated through investment, which in turn depends
on savings.
I Consumer also owns the firm.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 6


The budget constraint

I Household income comes from renting both productive factors


to the production sector, at given rental prices.
I Household can do two things with these earnings: expend it in
consumption or save it.
I Then, the budget constraint is

Pt (Ct + St ) ≤ Wt Lt + Rt Kt + Πt

where

Pt = price of consumption good St = savings


Rt = user cost of capital Wt = wage
Πt = firm’s profits (= dividends)

I Since there is no money, we normalize Pt = 1 ∀t.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 7


Resource constraints

I Since time is spent either working or in leisure:

Ot + Lt = 1 ∀t

I Given this constraint, in what follows we write the instant


utility function as:
u(C, 1 − L)
I Because capital deteriorates over time, its accumulation is
subject to depreciation rate δ:

Kt+1 = (1 − δ)Kt + It

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 8


The financial sector

I To keep things simple, we assume that there is a competitive


sector that transforms savings directly into investment
without any cost.
I Thus
S t = It
I Combining this assumption with the budget constraint and the
capital accumulation equation, the consumer is constraint by

Ct ≤ Wt Lt + Rt Kt + Πt − St
≤ Wt Lt + Rt Kt + Πt − It
≤ Wt Lt + Rt Kt + Πt + (1 − δ)Kt − Kt+1
≤ Wt Lt + Πt + (1 + Rt − δ)Kt − Kt+1

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 9


The consumer problem

The consumer problem is to maximize her lifetime utility




E0 β t u(Ct , 1 − Lt )
t=0

subject to the budget constraint*

Ct = Wt Lt + Πt + (1 + Rt − δ)Kt − Kt+1 ∀t = 0, 1, . . .

where K0 is predetermined.

*
We impose equality
©Randall Romero Aguilar, PhD
because uC > 0. EC-3201 / 2019.I 10
The consumer problem: dynamic programming

I The consumer problem is recursive, so we can represent it by


a Bellman equation.
I Current capital is the state variable, next capital and labor are
the policy variables.
I Then we write
{ ′
}
V (K) = max

u(C, 1 − L) + β E V (K )
K ,L

subject to the budget constraint

C = W L + Π + (1 + R − δ)K − K ′

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 11


The consumer problem: solution

I The FOCs are:

uO = W uC (wrt labor)
′ ′
uC = β E V (K ) (wrt capital)

I The envelope condition is

V ′ (K) = (1 + R − δ) uC

I Therefore, the Euler equation is


[ ]
uC = β E (1 + R′ − δ)uC ′

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 12


Consumer optimization: In summary

I For the numerical solution of the model, we assume that

u (Ct , 1 − Lt ) = γ ln Ct + (1 − γ) ln(1 − Lt )

I Therefore, the solution of the consumer problem requires

[ ]
Ct
1 = β E (1 + Rt+1 − δ)
Ct+1
γ
Ct = W (1 − Lt )
1−γ
Kt+1 = (1 − δ)Kt + It

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 13


Firms
The firms

I Firms produce goods and services the households will


consume of save.
I To do this, they transform capital K and labor L into final
output.
I They rent these factors from households.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 14


Production function

I Technology is described by the aggregate production function

Yt = At F (Kt , Lt )

where Yt is aggregate output and At is total factor


productivity (TFP).
I Production increases with inputs…

FK > 0 FL > 0

I …but marginal productivity of each factor is decreasing :

FKK < 0 FLL < 0

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 15


Production function (cont’n)

We assume that
I Production has constant returns to scale:

At F (λKt , λLt ) = λYt

I Both factors are indispensable for production

At F (0, Lt ) = 0 At F (Kt , 0) = 0

I Production satisfies the Inada conditions

lim FK = ∞ lim FL = ∞
K→0 L→0
lim FK = 0 lim FL = 0
K→∞ L→∞

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 16


The firm’s problem: static optimization

I Firms maximize profits, subject to the technological


constraint.

max Πt = Yt − Wt Lt − Rt Kt
Kt ,Lt

s.t. Yt = At F (Kt , Lt )

or simply

max At F (Kt , Lt ) − Wt Lt − Rt Kt
Kt ,Lt

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 17


The firm’s problem: solution

I The FOCs are:

Wt = At FL (Kt , Lt ) (wrt labor)


Rt = At FK (Kt , Lt ) (wrt capital)

that is, the relative price of productive factors equals their


marginal productivity.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 18


Side note:
Euler’s theorem
Euler’s theorem

Let f (x) be a C 1 homogeneous function of degree k on Rn+ . Then,


for all x,
∂f ∂f ∂f
x1 (x) + x2 (x) + · · · + xn (x) = kf (x)
∂x1 ∂x2 ∂xn

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 19


Proof

Because f (x) is homogeneous of degree k on Rn+ :

f (λx) = f (λx1 , λx2 , . . . , λxn ) = λk f (x)

Then, since f (x) is C 1 , for all x we take derivative with respect to


λ:
∂f ∂f ∂f
x1 (x) + x2 (x) + · · · + xn (x) = kλk−1 f (x)
∂λx1 ∂λx2 ∂λxn
Finally, setting λ = 1 we get the result.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 20


The firm’s profits

I Since F is homogeneous of degree one (constant returns to


scale), Euler’s theorem implies

[At FK (Kt , Lt )] Kt + [At FL (Kt , Lt )] Lt = Yt

I Substitute FOCs from firms problem:

Rt Kt + Wt Lt = Yt

I and therefore optimal profits will equal zero:

Πt = Yt − Rt Kt − Wt Lt = 0

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 21


The total factor productivity

I The TFP At follows a first-order autoregressive process:

ln At = (1 − ρ) ln Ā + ρ ln At−1 + ϵt

where the productivity shock ϵt is a Gaussian white noise


process:
ϵt ∼ N (0, σ 2 )
I This assumption led to the birth of the Real Business Cycle
(RBC) literature.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 22


The total factor productivity (cont’n)
I The TFP process can also be written
( )
ln At − ln Ā = ρ ln At−1 − ln Ā + ϵt

I In equilibrium, At = Ā.
I Productivity shocks cause persistent deviations in productivity
from its equilibrium value:
( )
∂ ln At+s − ln Ā
= ρs−1 > 0
∂ϵt
as long as ρ > 0.
I Although persistent, the effect of a shock is not permanent
( )
∂ ln At+s − ln Ā
lim = ρs−1 = 0
s→∞ ∂ϵt

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 23


Firm optimization: In summary

I For the numerical solution of the model, we assume that

At F (Kt , Lt ) = At Ktα L1−α


t and Ā = 1

I Therefore, the solution of the firm problem requires

( )α
Kt Yt
Wt = (1 − α)At = (1 − α)
Lt Lt
( )1−α
Lt Yt
Rt = αAt =α
Kt Kt
Yt = At Ktα L1−α
t
ln At = ρ ln At−1 + ϵt

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 24


The competitive equilibrium
Putting the agents together

I The equilibrium of this models depends on the interaction of


consumers and firms.
I Households decide how much to consume Ct , to invest (save)
It = St , and to work Lt , with the objective of maximizing
their happiness, taking as given the prices of inputs.
I Firms decide how much to produce Yt , by hiring capital Kt
and labor Lt , given the prices of production factors.
I Since both agents take all prices as given, this is a competitive
equilibrium.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 25


The competitive equilibrium

The competitive equilibrium for this economy consists of


1. A pricing system for W and R
2. A set of values assigned to Y , C, I, L and K.
such that
1. given prices, the consumer optimization problem is satisfied;
2. given prices, the firm maximizes its profits; and
3. all markets clear at those prices.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 26


The competitive equilibrium (cont’n)
Competitive Equilibrium
The competitive equilibrium for this economy consists of prices Wt and
Rt , and quantities At , Yt , Ct , It , Lt and Kt+1 such that:

[ ] I First 3 equations characterize


Ct
1 = β E (1 + Rt+1 − δ) solution of consumer problem
Ct+1
I Next 3 equations characterize
γ
Ct = W (1 − Lt ) solution of firm problem
1−γ
I Next equation governs dynamic
Kt+1 = (1 − δ)Kt + It of TFP
Yt I Last equation implies
Wt = (1 − α)
Lt equilibrium in goods markets
Yt I Equilibrium in factor markets is
Rt = α
Kt implicit: we use same K, L in
consumer and firm problems
Yt = At Ktα L1−α
t
I Later, we use these 8 equations
ln At = ρ ln At−1 + ϵt in IRIS to solve and simulate
Yt = Ct + It the model.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 27


Welfare theorems

If there are no distortions such as (distortionary) taxes or


externalities, then
1st Welfare Theorem The competitive equilibrium characterized in
last slide is Pareto optimal
2nd Welfare Theorem For any Pareto optimum a price system Wt ,
Rt exists which makes it a competitive equilibrium

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 28


The central planning equilibrium
The central planner

I An alternative setting to a competitive market environment is


to consider a centrally planned economy
I The central planner makes all decisions in the economy.
I Objective: the joint maximization of social welfare
I Prices have no role in this setting.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 29


The central planner problem

The central planner problem is to maximize social welfare




E0 β t u(Ct , 1 − Lt )
t=0

subject to the constraints ∀t = 0, 1, . . .

Ct + It = Yt (resource constraint)
Yt = At F (Kt , Lt ) (technology constraint)
Kt+1 = (1 − δ)Kt + It (capital accumulation)

where K0 is predetermined. The three constraints can be


combined into

Ct + Kt+1 = At F (Kt , Lt ) + (1 − δ)Kt

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 30


The central planner problem: dynamic programming

I The central planner problem is recursive too, so we can


represent it by a Bellman equation.
I “Current capital” is the state variable, “next capital” and
“labor” are the policy variables.
I Then we write
{ ′
}
V (K) = max

u(C, 1 − L) + β E V (K )
K ,L

subject to the constraint

C = AF (K, L) + (1 − δ)K − K ′

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 31


The central planner problem: solution

I The FOCs are:

uO = uC AFL (K, L) (wrt labor)


′ ′
uC = β E V (K ) (wrt capital)

I The envelope condition is

V ′ (K) = [AFK (K, L) + 1 − δ] uC

I Therefore, the Euler equation is


{[ ] }
uC = β E AFK ′ (K ′ , L′ ) + 1 − δ uC ′

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 32


Central planner optimization: In summary

I For the numerical solution of the model, we assume again that

u (Ct , 1 − Lt ) = γ ln Ct + (1 − γ) ln(1 − Lt )
F (Kt , Lt ) = Ktα L1−α
t

I Therefore, the solution of the central planner problem requires

[( ) ]
Yt+1 Ct
1=βE α +1−δ
Kt+1 Ct+1
γ Yt
Ct = (1 − α) (1 − Lt )
1−γ Lt
Kt+1 = (1 − δ)Kt + It

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 33


The central planning equilibrium
The central planning equilibrium
The central planning equilibrium for this economy consists quantities
At , Yt , Ct , It , Lt and Kt+1 such that:

[( ) ]
Yt+1 Ct
1=βE +1−δ
α
Kt+1 Ct+1
Ct γ Yt
= (1 − α)
1 − Lt 1−γ Lt
Kt+1 = (1 − δ)Kt + It
Yt = At Ktα Lt1−α
ln At = ρ ln At−1 + ϵt
Yt = Ct + It
I These equations characterize
solution of the social planner
problem
I There are no market
equilibrium conditions, because
©Randall Romero Aguilar, PhD EC-3201 / 2019.I 34
Central planner vs. competitive market equilibria

I The solution under a centrally planned economy is exactly the


same as under a competitive market.
I This is because there are no distortions in our model that
alters the agents’ decisions regarding the efficient outcome.
I Only difference: In central planner setting there are no
markets for production factors, and therefore no price for
factors either.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 35


The steady state
The steady state

I The steady state refers to a situation in which, in the absence


of random shocks, the variables are constant from period to
period.
I Since there is no growth in our model, it is stationary, and
therefore it has a steady state.
I We can think of the stead state as the long term equilibrium
of the model.
I To calculate the steady state, we set all shocks to zero and
drop time indices in all variables.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 36


Computing the steady state for the competitive equilibrium

In this case, the steady state consists of prices W̄ and R̄, and
¯ L̄ and K̄ such that:
quantities Ā, Ȳ , C̄, I,
γ
1 = β(1 + R̄ − δ) C̄ = W̄ (1 − L̄)
1−γ

I¯ = δ K̄ W̄ = (1 − α)


R̄ = α Ȳ = ĀK̄ α L̄1−α

Ā = 1 Ȳ = C̄ + I¯

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 37


IRIS
IRIS

I IRIS is a free, open-source toolbox for macroeconomic


modeling and forecasting in Matlab®, developed by the IRIS
Solutions Team since 2001.
I In a user-friendly command-oriented environment, IRIS
integrates core modeling functions (flexible model file
language, tools for simulation, estimation, forecasting and
model diagnostics) with supporting infrastructure (time series
analysis, data management, or reporting).
I It can be downloaded from Github.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 38


Solving the model with IRIS

I To solve the model, one creates two files


.model Here we describe the model: declare its
variables, parameters, and equations
.m this is a regular MATLAB file. Here we load the
model, solve it, and analyze it.
I The code presented here is based on Torres (2015, pp.51-52),
which was written to be used with DYNARE instead of IRIS.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 39


The .model file: Define variables

IRIS, part 1
I The .model file is a text file,
where we declare (usually) ! transition_variables
’ Income ’ Y
four sections: ’ Consumption ’ C
I !transition_variables ’ Investment ’ I
I !transition_shocks ’ Capital ’ K
’ Labour ’ L
I !parameters ’Wage ’ W
I !transition_equations ’ Real i n t e r e s t r a t e ’ R
’ Productivity ’ A
I Although not required, using
'labels' greatly improves ! transition_shocks
’ P r o d u c t i v i t y shock ’ e
readability.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 40


Model calibration

For the model to be completely computationally operational, a


value must be assigned to the parameters.

Parameter Definition Value


α Marginal product of capital 0.35
β Discount factor 0.97
γ Preference parameter 0.40
δ Depreciation rate 0.06
ρ TFP autoregressive parameter 0.95
σ TFP standard deviation 0.01

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 41


The .model file: Define and calibrate parameters

I In the !parameters section, we declare all parameters (so we


can use them later in the equations)
I Optionally, we can calibrate them here, (otherwise we do it in
the .m file)

IRIS, part 2

! parameters
’ Income s h a r e o f c a p i t a l ’ a l p h a = 0 . 3 5
’ Discount f a c t o r ’ beta = 0 . 9 7
’ P r e f e r e n c e s parameter ’ gamma = 0 . 4 0
’ Depreciation r a t e ’ d e l t a = 0.06
’ A u t o r r e g r e s i v e parameter ’ rho = 0 . 9 5

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 42


The .model file: Specify the model equations
I Equations are separated by semicolon
I Lags are indicated by {-n}, leads by {+n}
IRIS, part 3

! transition_equations
’ Consumption v s . l e i s u r e c h o i c e ’
C = (gamma/(1−gamma) ) *(1−L ) *(1− a l p h a ) *Y/L ;
’ Euler equation ’
1 = beta * ( (C/C{+1}) * (R{+1} + (1− d e l t a ) ) ) ;
’ Production function ’
Y = A*(K{−1}^ a l p h a ) * ( L^(1− a l p h a ) ) ;
’ C a p i t a l accumulation ’
K = I + (1 − d e l t a ) * K{−1};
’ Investment equals savings ’
I = Y − C;
’ Labor demand ’
W = (1− a l p h a ) * A * (K{−1} / L ) ^ a l p h a ;
’ C a p i t a l demand ’
R = a l p h a * A * ( L / K{−1})^(1− a l p h a ) ;
’ P r o d u c t i v i t y AR( 1 ) p r o c e s s ’
l o g (A) = rho * l o g (A{−1}) + e ;
©Randall Romero Aguilar, PhD EC-3201 / 2019.I 43
The .m file: Working with the model

Matlab, part 1
I The .m file is a Matlab file,
where we work with the
clear all
model close all
I To work with IRIS, we need clc
to add it to the path using addpath C: \ IRIS
addpath i r i s s t a r t u p ()
I It is recommended to start %% READ MODEL FILE
with a clean session m = model ( ’ t o r r e s −
I We read the model using c h a p t e r 2 . model ’ ) ;
model

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 44


The .m file: Finding the steady state

Matlab, part 2

%% INITIAL VALUES
P = g e t (m, ’ params ’ ) ;
I IRIS uses the sstate P .Y = 1 ;
command to look for the P.C = 0 . 8 ;
P. L = 0 . 3 ;
steady state P .K = 3 . 5 ;
I To use it, we have to guess P. I = 0 . 2 ;
P .W = (1−P . a l p h a ) *P .Y/P . L ;
initial values, which we P . R = P . a l p h a * P .Y/P .K;
assign to the model, P .A = 1 ;
starting with the initial
%% STEADY STATE
parameters in m = a s s i g n (m, P) ;
get(m,'params') m = s s t a t e (m, ’ b l o c k s=’ , t r u e ) ;
c h k s s t a t e (m)
g e t (m, ’ s s t a t e ’ )

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 45


Steady states: results

We find that the steady state is given by

Variable Definition Value Ratio to Ȳ


Ȳ Output 0.7447 1.000
C̄ Consumption 0.5727 0.769
I¯ Investment 0.1720 0.231
K̄ Capital 2.8665 3.849
L̄ Labor 0.3604 -
R̄ Capital rental price 0.0909 -
W̄ Real Wage 1.3431 -
Ā TFP 1.0000 -

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 46


The .m file: Solving and simulating the model

I IRIS uses the solve and


simulate commands to Matlab, part 3
get the solution and run
simulations of the model. %% SOLUTION
m = s o l v e (m) ;
I Here, we simulate the
impact of an unanticipated %% SIMULATE PRODUCTIVITY SHOCK
t t = −10:50; %time range
10% increase in total t s h o c k =0; % shock date
factor productivity: d = s s t a t e d b (m, t t ) ;
d . e (0) = 0.10;
s = s i m u l a t e (m, d , t t , ’
ln At = 0.95 ln At−1 + ϵt A n t i c i p a t e=’ , f a l s e ) ;

I Notice how persistent the


shock is.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 47


The .m file: Solving and simulating the model

A
1.12

1.1

1.08

1.06

1.04

1.02

1
-10 0 10 20 30 40 50

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 48


Responses of endogenous variables to productivity shock

Y, @-1 C, @-1
0.15 0.1

0.08
0.1
0.06

0.04
0.05
0.02

0 0
0 20 40 0 20 40

I, @-1 K, @-1
0.4 0.15

0.3
0.1

0.2

0.05
0.1

0 0
0 20 40 0 20 40

Relative deviations respect to pre-shock values

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 49


Responses of endogenous variables to productivity shock

L, @-1 W, @-1
0.06 0.1

0.08
0.04
0.06
0.02
0.04
0
0.02

-0.02 0
0 20 40 0 20 40

K, @-1 R, @-1
0.15 0.15

0.1
0.1

0.05

0.05
0

0 -0.05
0 20 40 0 20 40

Relative deviations respect to pre-shock values

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 50


References I

Torres, Jose L. (2015). Introduction to Dynamic Macroeconomic General


Equilibrium Models. 2nd ed. Vernon Press. isbn: 1622730240.

©Randall Romero Aguilar, PhD EC-3201 / 2019.I 51

You might also like