Dynamic Stochastic General Equilibrium (DSGE) Models in STATA

DSGE Models in Stata - Free Course Overview

This course will teach you how to estimate DSGE models in Stata. DSGE models are macro-microfounded models which focus on growth and business cycles. Throughout the tutorials, you will learn the difference between Non-Keynesian and New Keynesian models. Next, we will discuss Real Business Cycle (RBC) models. We will review how agents interact in the economy, the sources of fluctuation in business cycles and the general equilibrium. Finally, we write the model in the software to calculate the steady-state; impulse response functions and produce some out-of-sample forecasts. If you would like to join an online paid webinar to learn with greater details DSGE models, don't hesitate to get in touch with me.

Enjoy the course!

What are dynamic stochastic general equilibrium (DSGE) models?

DSGE stands for dynamic stochastic general equilibrium model. DSGE models became popular in the early 80s, after Lucas’s critique (1976). Kydland and Prescott (1982) introduced the real business cycle model. DSGE models are microfounded models focused on economic growth and business cycles. The benchmark RBC model is similar to the Neoclassic Solow model but incorporates a stochastic shock in the firms’ productivity. 

According to the RBC theory, business cycles are caused by fluctuations in productivity or technology. In periods of higher productivity, business cycles expand, whereas in periods where technology diminishes, cycle contracts. There is no role for money in RBC models. Money indeed is neutral.

 Diverse critics arise to RBC models as they assume perfect competition and elastic prices. New Keynesian DSGE models incorporate some frictions to improve how the models assimilate business cycles. Sticky prices, nominal rigidities, imperfect competition, and investment costs are features included in New Keynesian DSGE models. 

Central banks rely on DSGE models to evaluate the impact of various monetary/fiscal policies. It is always important to remember that there is no perfect model, but some help us explain things. 

How to estimate DSGE models in Stata

In the following videos, we will cover from A to Z how to estimate a non linear DSGE model in Stata. We will manually solve the maximization problem of each of the participants in our sample economy and write the dynamic equations in the software. We conclude the analysis with calibration, data filters, impulse-responses and an out of sample forecast.

Table Of Contents

1-Introduction to RBC Models

Learn what RBC models are. Know the different theories that explain business cycles and get familiar with the model setup and existing literature.

2-Household's Maximization Problem

Learn how to solve the household's maximization problem. Families maximize their utility subject to a budget constraint, and decide how much labour to offer and the intertemporal consumption decision (Euler Equation).

3-Firm's Maximization Problem

Learn how to solve the firm's maximization problem. Firms maximize their profits subject to a budget constraint, and decide how much labour and capital to demand.


4-Model Equilibrium

Define the competitive equilibrium in the model and present the dynamic equations. Learn what are the variables and parameters to be estimated, and calibrated.

5-Write the DSGE Equations in Stata 

Learn how to write the dynamic equations of the DSGE model in Stata. You will learn the "dsgenl" command, the three type of variables involved in DSGE models in Stata and how to define parameters and specify some mandatory options. 

6-Data filters and Calibration

Time to calibrate the model and import the data. We need to decompose real GDP into trend and cycle. To decompose a series into trend and cycle we review the Hodrick-Prescott (HP) Filter. 

7- Steady State and Impulse Responses 

Learn how to calculate the steady state, obtain the variance covariance matrix, verify the sability conditions and graph the impulse response Functions (IRF).

8-Forecast & Performance

Learn how to produce an out of sample Forecast. Finally, learn how to review the model performance by comparing data moments and producing a 1 step ahead prediction.

Sign up to my newsletter

Course Material

You can download for free the dynamic equations of the model, which will be very important when we write down the model in STATA. Shortly, a link to buy the whole course material will be available (Includes Slides, STATA DO File and paper with the maths step by step solution).

 1 - Download Dataset (Free)