Linearizing around a steady state = 0

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.

  1. Your model is not linearized at all. But that’s not a problem.
  2. For variables with steady state 0, it’s common to linearize instead of loglinearizing them.

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.