RBC model: deriving model equations and introduction to Dynare's preprocessor
How to derive the model equations of the baseline Real Business Cycle model and introduce Dynare’s preprocessor.
This video is part of a series of videos on the baseline Real Business Cycle model and its implementation in Dynare. It also overviews and introduces basic features of Dynare’s preprocessor like workspace variables, global structures, dynamic vs. static model equations, Latex capabilities and model local variables.
Video
VIDEO
Timestamps
Theory Part 1: Model Structure
0:01:01 - Overview
0:03:48 - Representative Household
0:07:10 - Capital Accumulation
0:08:29 - Representative Firm
0:10:48 - Stochastic Processes
0:11:29 - Closing Conditions: Non-Negativity, Market Clearing, Transversality Condition
Theory Part 2: Optimality Conditions of Household
0:15:37 - Lagrangian
0:18:02 - Derivation of First-Order Conditions (Pen&Paper)
0:22:32 - Interpretation of First-Order Conditions
Theory Part 3: Optimality Conditions of Firm
0:24:38 - Lagrangian
0:26:09 - Derivation of First-Order Conditions
0:28:23 - Interpretation of First-Order Conditions
Theory Part 4: Nonlinear Model Equations
0:29:32 - Summary of model
Dynare Part 1: Implementation and Tips
0:30:24 - Creating and Working with MOD files
0:32:07 - Declaring variables and parameters, difference between Dynare code blocks and MATLAB code
0:36:03 - Entering model equations in model block
0:37:54 - running Dynare, addpath, dealing with preprocessor error message
Dynare Part 2: Preprocessor
0:40:14 - Overview preprocessor, workspace, global structures, files, folders, driver.m
0:44:28 - Preprocessor dynamic vs. static model files
0:46:37 - Latex features
0:51:50 - Preprocessor conditional if statements, savemacro
Outro & References
1:00:32 - Outro
1:01:36 - References
Slides and notes
Codes
rbc_nonlinear.mod
@
v
;
m
;
v
;
p
;
%
A
B
D
G
P
R
@
E
E
@
m
%
@
@
@
%
#
#
%
u
%
w
%
k
%
y
%
y
%
m
%
w
%
r
%
l
e
w
w
w
w
w
c
i
e
#
a
o
a
a
L
E
E
A
S
H
#
T
T
#
o
m
#
#
#
m
f
f
c
c
o
n
r
r
r
r
r
o
f
n
d
r
y
c
k
l
a
r
w
i
m
d
u
u
u
f
f
r
e
r
B
D
G
P
@
E
E
@
A
R
P
P
T
L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