Dsge modelling using dynare

Hi dear community,

I’am beginner in Dynar and I would like to have some help to perform a DSGE model.

Thank you all.

What is your specific question?

1 Like

Hi Sir,
I want to know the equations we write down in a dynare (Are the equations of maximisation or the constraint of the agent or the first order conditions) and how the steady state is calculated ?

Thank you for your help.

  1. You need all equations describing the equilibrium of the model. That is all the FOCs, including the constraints (which are a FOC with respect to the Lagrange multiplier).
  2. The steady state can be computed by dropping time indices and setting shocks to 0.
1 Like

Thank you professor for your answers. But, as a beginner some notions seem to be difficult to understand. For example , how can we know the equations that describe the equilibrium ? And if we have for example a maximization problem for household subject to a constraint, do we need just the equation and the constraint and in which case we must add the FOC’s?

If you are interested, you have resources such as Matlab and Dynare Codes | Eric Sims, DSGE_mod/RBC_baseline at master · JohannesPfeifer/DSGE_mod · GitHub and on youtube “RBC Baseline Model Equations and Introduction to preprocessing with Dynare” by Willi Mutschler to have a better global view on the matter.

1 Like

Please, can you give me an example of a dsge model with equations and its implementation in dynare.

In addition to the previous links above, you may have a look at the following: https://archives.dynare.org/documentation-and-support/user-guide/Dynare-UserGuide-WebBeta.pdf/at_download/file. It may not be up to date but it introduces simple examples with the equations and the respective codes. Probably, you have already seen it but Prof. Pfeifer also provides an explanatory document with codes at Johannes Pfeifer - Dynare.

THANK YOU FOR YOUR RESPONS. However, it stils confusing for me. Can you give me easier documentation.

Besides the youtube channel of Willi Mutschler (https://www.youtube.com/@wmutschl/videos) where he runs a baseline RBC model (see https://www.youtube.com/watch?v=ZfsKGzR84hQ) step by step, I do not know what else I can show you…

THANK YOU. For example, are the steady state calculated manually or dynare automatically do it ?

According to the manual, section 4.10 in 4. The model file — Dynare 6.1 documentation, I quote:

There are two ways of computing the steady state (i.e. the static equilibrium) of a model. The first way is to let Dynare compute the steady state using a nonlinear Newton-type solver; this should work for most models, and is relatively simple to use. The second way is to give more guidance to Dynare, using your knowledge of the model, by providing it with a method to compute the steady state, either using a steady_ state_model block or writing matlab routine.

If you read further down, you see that dynare proposes several algorithms to solve for the steady state. Obviously, depending on the model, if you guesses are too far off, you will not get any results.

FOR EXAMPLE, WHEN I HAVE THE UTILITY FUNCTION OF HOUSEHOLDS AND THE CONSTRAINT. THE FOC’s CALCULATED ARE WRITTEN DOWN IN DYNARE NOT THE UTILITY FUNCTION OF HOUSEHOLDS NEITHER CONSTRAINT. IS IT RIGHT?
SORRY FOR BOTHERING.

No worries. Someone can correct me but I think that the resource constraint will always somehow appear, directly or indirectly (depending on the model), but it is true that you do not usually write the utility function. I highly encourage you to watch the Willi Muschler video on the basic RBC model.

No, the utility function is not a first order condition of the model and will not be entered (unless you define Welfare as an auxiliary variable). The constraints need to be entered as they are first order conditions (FOC with respect to the Lagrange multiplier).

Dear Professor,

I have dynare 5.5 in my machine, however I am trying to run a replication paper with a code I believe is from an earlier version of dynare, and I’m having problems running it. Can you suggest anything I should try at this point?

Without further information it is impossible to tell. What is the exact problem you are encountering. Ideally, provide the files in question.

Thank you for responding.

Please find the file, and tell me if it opens. Thanks

RR_LCR_Indo_alt1.mod (15.4 KB)

These are my output reports

Chawwa - errors-first-run.pdf (122.5 KB)

The problem is the new steady state file interface, but you did not provide the steady state files.