# Introduction to DSGE models and Dynare

## What you will learn

This video course provides an introduction to a very simple DSGE model and its implementation in Dynare. Topics like deriving model equations, computing the steady-state, calibrating model parameters and doing both deterministic as well as stochastic simulations are covered. Tips and tricks for making use of Dynare’s preprocessing capabilities, modularization of files and flipping of variables and parameters are presented.

## Course material

• ##### Intro Dynare solution and simulation

A quick and rough introduction to Dynare on MATLAB with a focus on solution and simulation methods.

• ##### RBC model: deriving model equations and introduction to Dynare's preprocessor

In this video we derive the baseline Real Business Cycle (RBC) model with leisure 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.

• ##### RBC model: steady-state derivations and implementation in Dynare (with preprocessing tips)

In this video we focus on computing the steady-state of the RBC model both analytically and numerically. First, we derive the steady-state using pen and paper and then implement this using either an initval or steady_state_model block in Dynare. We also cover “helper functions” that introduce numerical optimization in an otherwise analytical steady_state_model block, in order to compute the steady-state for variables for which we cannot derive closed-form expressions by hand.

• ##### RBC model: simple vs advanced calibration using modularization and changing types

In this video I show how to calibrate the parameters of the RBC model in a sophisticated way using Dynare’s preprocessing capabilities. First, we cover some general ideas and tips how to calibrate the parameters of a DSGE model, focusing on the RBC model with leisure. Then I show how to accomplish this in Dynare either directly or, a more advanced way, by modularizing your mod file and changing the type of variables and parameters. Once you start working with large-scale models, this modularization technique will make your models much more tractable.

• ##### RBC model: deterministic vs stochastic simulations

In this video I focus on simulations and discuss the difference between the deterministic and stochastic model framework of Dynare. I provide intuition how Dynare “solves” or “simulates” these different model frameworks and guidance on when to run either deterministic or stochastic simulations. Then I show how to simulate various scenarios in the baseline RBC model. In the deterministic case (i.e. under perfect foresight), this videos covers (i) unexpected or pre-announced temporary shocks, (ii) unexpected or pre-announced permanent shocks, (iii) return to equilibrium by using Dynare’s perfect_foresight_setup and perfect_foresight_solver (i.e. the old simul) commands and the shocks, initval, endval and histval blocks. I show what happens in MATLAB’s workspace and to Dynare’s output structure oo_. In the stochastic case, this videos covers (i) impulse-response-functions (irf), (ii) variance decompositions, (iii) theoretical vs. simulated moments, (iv) data simulation by using Dynare’s stoch_simul command and the shocks block. I show what happens in MATLAB’s workspace and to Dynare’s output structures oo_ and oo_.dr. Lastly, the difference between Dynare’s declaration and DR (decision-rule) ordering of variables is covered.

• ##### Understanding numerical steady-state computations

This is a Zoom recording (hope the quality is still okay) of a session on computing the steady-state of DSGE models numerically. I try to explain what the underlying objective function is and what it means to use numerical optimization techniques. This is illustrated by the RBC model, preprocessed manually in MATLAB and using different optimization methods. I also compare this to what Dynare’s steady command does.Note that Dynare’s steady command is capable to do much more things than I cover in this video, but I still hope this is useful for people to understand the underlying objective and approach.