
Welcome to the course
First of all, I would like to thank you for your purchase! I hope you enjoy the course and that it helps you to deepen your understanding of DSGE models and Dynare.
Please ensure to download the guide I wrote which contains all the models, math and explanations.
You can watch the videos with captions
Languages available: English, Spanish, Portuguese, French.
Introduction to the basic model
In this video I introduce you the participants in the sample economy and the main features of the baseline RBC model.
Households
In our Real Business Cycle (RBC) Model, households derive utility from consumption and leisure. In other words, families are happier when they consume and rest more. As we know, nothing is free in this world. Households can consume and rest subject to a budget constraint. What is the household’s budget constraint? Their income. Families in our model obtain payment from working (wages) and renting capital to the firms (get returns). In our sample model, households save the money that is left after consuming. Furthermore, savings turn into investments immediately without any costs. Families invest in capital. Families rent their capital to the firms to produce output.
After solving the maximization problem, families will decide two things optimally:
1-How much to consume: Intertemporal Euler Equation
2-How much labour to supply.
Firms
In real business cycle (RBC) models, we assume perfect competition. Profits in the equilibrium are equal to 0. Firms will produce the goods and services that families consume. The production function of the firms is Cobb-Douglas. Firms require capital and labor to make the final output. Also, firms are subject to a technology shock. The shock is a stochastic exogenous shock that follows an autoregressive order. When the productivity of the firm’s increases (due to the productivity shock), firms become more productive and see a significant increase in their output. To keep up with the production, they demand more labour and capital. The increase in the demand for inputs implies that the wages and returns to capital will have to increase.
Defining the General Equilibrium
Now we can define the model equilibrium. How the two agents interact in the economy will determine the model equilibrium. Finding a general equilibrium implies that all markets are in equilibrium (goods, capital and labour). Families have to decide how much to consume, save/invest and work. Firms have to decide how much to produce depending on inputs (capital and labour). Formally speaking, finding a DSGE model equilibrium implies finding a sequence of the variables: consumption, leisure, investments, capital and labour; and a set of prices: wages and returns, such that:
1- Families will maximize their utility given wages and returns.
2- Firms maximize their profit given the prices of wages and returns.
3-Feasibility condition of the economy holds.
Introduction to Dynare
In this video, I will show you how to get started with Dynare. We will talk about Dynare's layout, and how to create a new script and save the document in the proper format.
Next, we will go through the steps to write the exogenous variables, endogenous variables and parameters of the model.
How to write the dynamic equations in Dynare
In this video, we will see how to write the dynamic equations of the model.
The file to replicate the model is available to download below.
Important timing convention in Matlab-Dynare:
If the variable is decided in [t−1], such as the capital stock, we should write them as (-1)
On the other hand, when a variable is decided in the next period, [t+1], such as consumption in the Euler equation, we should write it using (+1)
Introduction: Oil in the Economy
In this video, we cover the foundations of the oil model.
How to solve the oil model manually
In this video, I show you how to solve the oil model manually.
Note: the households' maximization problem remains the same. We only solve the firms' maximization problem as we have incorporated a new input: oil.
How to write the oil model in Matlab-Dynare
In this video I show you how to write the model in the software.
The file to replicate the model is available to download below.
Please note:
In the minute 2:51 the production function should read:
y = a*(k(-1)^alpha)*(h^theta)*(o^(1-alpha-theta));
(In the video, I forgot to add the "^").
I apologize for the oversight.
Regards,
Commands to estimate the model
In this video, we import the dataset and then I show you the main commands you need to know to estimate the model.
We introduce in the script:
1- Observable variables
2- Estimated parameters block, where we define the variable we want to estimate (you can also estimate parameters) and we select the prior density function.
3- Estimation command. There are many options that you can include in the estimation command, so please make sure that you check the Dynare manual. There are some options that may be useful when estimating complex models.
Feel free to download the model script below and the dataset.
Impulse Response Functions Analysis
In this video we run the model. We get the results and review the output.
We talk about MCMC, which stands for Monte Carlo Markov Chain.
Also, we talked about the Metropolis algorithm:
The Metropolis Hasting algorithm will generate a sample from the posterior distribution of epsilon. Then, it uses the sample to estimate the mean of the posterior distribution.
The Monte Carlo process generates random values, while the Markov chain will make values dependent on the previous draws. Finally, the algorithm will pick which draws to accept or reject (the acceptance ratio).
I show in the video how to change the number of replications in each chain (we set it to 2000 replications).
I show you how to modify the number of values to drop in the burn in phase of the algorithm.
I show you how to tune the acceptance ratio.
We change the prior distribution of epsilon to allow only positive values (we use the inverse gamma distribution).
We conclude the video analyzing the impulse response functions.
Feel free to download the file to replicate the model modified.
Are you looking to dive into the world of macroeconomics DSGE models? Then look no further! This course will serve as your comprehensive guide to utilizing Matlab Dynare for DSGE model analysis. You will gain extensive knowledge and understanding of the fundamental concepts and principles of DSGEs and how they are implemented in Matlab Dynare. Get ready to explore this fascinating field and equip yourself with the skills to solve complex macroeconomic problems!
This course will teach you how to calibrate and estimate DSGE models in Matlab-Dynare. DSGE models are macro-microfounded models which focus on growth and business cycles. As the world of macroeconomics continues to evolve, Dynamic Stochastic General Equilibrium (DSGE) models are becoming increasingly popular. Yet getting familiar with DSGE models and the software Dynare without guidance can be challenging. Unfortunately, there aren't many didactic courses available to help individuals navigate this complex subject and those that do exist come with a hefty price tag (yes, thousands of dollars). It can be discouraging and overwhelming at times, but don't despair! I am here to tell you that help is available, and it doesn't have to cost you an arm and a leg.
I have created this course specifically for individuals seeking guidance on this complex subject.
In this course, I show you step by step how to manually solve a simple RBC model and then how to calibrate it in Dynare. No previous knowledge of the software is required! I will walk you through each part of the process with clear explanations. You'll get to understand the fundamentals of how a model works and gain insight into what goes on behind the scenes when calibrating a model. But that's not all!
Now that we are all familiar with the structure of the basic model, let us explore how we can expand it by introducing oil into the production function. By doing so, we will be able to gain a deeper insight into sources of fluctuation in economies around the world. Adding oil to the model will help us better understand how changes in its availability and price can affect households and firms alike.
We conclude the course by estimating the simple RBC model. I will show you not only how to calibrate a model, but also, the commands you need to know to bring data into the software and estimate it.
If you are new to Dynare and DSGE models, you may feel overwhelmed by all the new information. Never fear though, because I am confident that this course can help you get a handle on it all. This course is tailored for beginners and those who don't have any prior experience with the software, so it should be a great place to start. However, it may not be suitable for advanced MATLAB users.
The course being discussed here is an English-language course, and it allows students to turn on captions in four different languages: English, Spanish, French and Portuguese. This flexibility gives students from all backgrounds access to a learning experience that suits their individual needs and preferences. With these captions available, learners can better follow along with the material and retain what they’ve learned.