Dear all,
I am very new to Dynare and have been struggling with having Dynare computing the steady state of my model in order for it to run basic IRF simulations.
The model itself is extremely simple but I have a feeling I might be confusing Dynare in my code.
My first issue is that I would like bonds B to be equal to 0 in the steady state which causes an issue when also including log(B) in the var list, model and steady_state_model block. My understanding is that you specify a log(.) version of all the variables that need to be log-linearized?
In my model, I only have one variable expressed in a non-linear equation (eq. 8), which shows the dynamic path for P. I assume Dynare log-linearizes this equation which is why I have also entered log(P) in the var list, model and steady_state_model block, along with three of my other variables of interest, B, C_H and C_F, which are functions of P.
I am attaching my
simplemodel.mod (2.5 KB)
-file here. How can I modify my code to overcome the B=0 in the steady state issue? Could there also be something wrong with my eq 8? My eq 8 is just eq 1 plugged into eq 4. When using the resid command, I get:
Residuals of the static equations:
Equation number 1: Market clearing condition : 0.000000
Equation number 2: Price ratio and marginal utility optimality : 0.000000
Equation number 3: Country budget constraint : 0.000000
Equation number 4: Euler equation Home goods : 0.000000
Equation number 5: Euler equation Foreign goods : 0.000000
Equation number 6: Optimal level of B : 0.000000
Equation number 7: Optimal level of Foreign goods : -0.000000
Equation number 8: Dynamic path of price P : -0.103924
Equation number 9: log_P : 0.000000
Equation number 10: log_P_C : 0.000000
Equation number 11: log_P_F : 0.000000
Equation number 12: log_C_F : 0.000000
Equation number 13: log_C_H : 0.000000
Equation number 14: log_B : Inf
Equation number 15: log_Y : 0.000000
Equation number 16: log_Y_C : 0.000000
Equation number 17: log_R : 0.000000
Equation number 18: Exog. Shock process in log form : 0.000000
Any help or suggestions would be immensely appreciated. Thank you!
You set log_B = log(B) and then you set B=0
Therefore you will encounter with error in dynare output results.
Thank you Eisa for your answer, I see your point.
Would you recommend me to remove the log_B=log(B) variable altogether from the mod-file and just keep B as it is in level-form, considering that I really do need the steady state level of bonds B to be 0?
Does that imply I should change from log_B to just B (i.e. level-form) in the stoch_simul command?: stoch_simul(order=1,irf=30) B log_P log_C_H log_C_F log_P_C;
My concern is that B would still need to be linearized somehow before the stoch_simul command as it is a function of P, and P requires log-linearization since P does not have a closed-form solution? Or do I just assume Dynare will handle B such that it can compute the IRF results for B log_P log_C_H log_C_F log_P_C? Apologies if this is very obvious
Many thanks
I have worked with the other DSGE model like your model and more advanced than your model.
I Log-linearized all of the model equations manually then I used model(linear) in Dynare mod file.
I did not encounter with any problem such as your model.
Thank you both for your advice. I have removed log(B) entirely, and now get residuals of 0 everywhere which is great. However, when I run the file I now get the following error:
Error using print_info
The generalized Schur (QZ) decomposition failed. For more information, see the documentation for Lapack function dgges: info=30, n=7. You can also run model_diagnostics to get more information on what may cause this problem.
Error in check (line 48)
print_info(info, 0, options_);
Error in test.driver (line 484)
oo_.dr.eigval = check(M_,options_,oo_);
Error in dynare (line 310)
evalin(ābaseā,[fname ā.driverā]);
My understanding is that the Blanchard-Kahn conditions arenāt met? Some of the model equations I have entered in the model block are combinations of two other model equations (eg eq 8 is a result from plugging in eq 1 into eq 4). I presume there is no issue in doing so as I donāt really have more model equations to provide.
Iām trying to think of anything else that might be hindering Dynare from solving the model and computing the IRFs. Iām not entirely sure how I would go about linearizing B (eq 6) other than, perhaps, dividing it by the steady state level of exports so that you get b as a percentage share like in this paper on page 23, second equation where they use F which is 0 in the steady state.
Here is the updated test.mod (2.4 KB)
file with the above error message. Again, any suggestions would be deeply appreciated. Thank you
Use
resid;
steady;
check;
model_diagnostics;
Commands to see what is the modelās problem exactly as Dynare indicated you.
That is exactly the problem. Equation 8 is redundant and you are missing one equation.
Hi again,
I see, thank you. I have now removed the equations that are made up of the other specified equations and made some of my previous endogenous variables as parameters as Iām only really interested in looking at how four of my variables (C_H, C_F, P, B) vary when I introduce a shock. Dynare manages to compute the steady states and it produces IRFs for each variable, but it also tells me there is a unit root issue, that two eigenvalues are greater than 1 and that my Euler equation is collinear. Iāve been trying to figure out what equations might be redundant and what equations need to be there but have been stuck for some time. The four equations I have are:
- market clearing condition for C_H, 2) price ratio = marginal utilities of C_H and C_F (derived from setting up the lagrangian), 3) household budget constraint (the only constraint in the model), 4) Euler equation for C_H (derived from setting up the lagrangian).
Is there anything apparent that I might be doing wrong? Iām attaching the mod.file here in case. Thank you again for your guidance!
test.mod (1.7 KB)
My hunch is that no equation is missing, rather that the unit root is a feature of the model. You can see that some IRFs donāt return to steady state.
I see, interesting. That could definitely be possible as this is just a toy model Iāve been playing around with. Iāll think some more about how I could proceed with this, but thank you for all you help here!
Hi again,
Regarding the IRFs not returning to steady state, how can we tell from the graphs that it is not the permanent income hypothesis causing consumption to not return to their steady states? Iāve read other blog posts here where PIH has sometimes been suggested, or that ātricksā need to be applied to address non-stationarity inherent in the model. Any intuition as to why continuous debt accumulation (B<0 for all periods) causes NX surplus in the long-run, as seen in the IRF plots? Is this related to the non-stationarity of the model or is there actual economic meaning to this? Thank you for any advice.
Quite often it is indeed PIH at work. That debt dynamics you describe would be consistent with this.
Dear jpfeifer. Can you briefly talk about the difference between linearization and logarithmic linearization, I think few people have mentioned it
The difference is whether you express something in absolute deviations from steady state x_t-\bar x_t (linearization) or in percentage deviations \frac{x_t-\bar x_t}{\bar x} (log-linearization). That latter obviously does not work if the steady state is 0.
1 Like
dear jpfeifer,thank you very much for your answer.GalĆ et al.ļ¼2007ļ¼ Effects of Government Spending on Consumption.In this paper, the linearization is divided by the output steady state value, and a linearization equation is obtained. This is a different change from the linearization of our general equation. How to input this into dynare.
That is not really a different linearization but rather a different type of normalization.You can always define a variable as a share of GDP and then do a normal linearization.
1 Like