when I try to run my code I get this error message “The steadystate file did not compute the steady state”. So my steadystate file doesn’t seem to work. The code is largerly based on the model from Iacoviello 2005 and I tried hard to account for all issues. Could you please have a look on my code?
Any help would be appreciated!
The code is attached.
P.S. And the strange thing is that when I use model_steady_state block instead of the m-file, only four residuals remain non zero and others are zero. Could anybody please point out to me what I did wrong?
myreplic_steadystate.m (1.8 KB)
myreplic.mod (2.27 KB)
First of all, this is not the way you are supposed to write a steady state file! It is completely outdated. Where did you get it from? See [Steady state file) on how to do a modern version.
Second, if you can use a steady_state_model-block, do so. Only use a separate steady_state-file if absolutely necessary.
Third, given the displayed residuals, your steady state does not fit the model entered into Dynare. There must be a mistake somewhere, either in the equations with residuals or the computation of the steady states of the variables involved in these equations.
Dear Johannes, thanks a lot for your reply!
Now I managed to correct the code so as all residuals are zero and steady state can be computed. However, I have another problem. in this version of the code I don’t include retail sector and prices are assumed to be flexible. If I try to run the code, then Blanchard Kahn conditions are not satisfied - There are 5 eigenvalue(s) larger than 1 in modulus for 6 forward-looking variable(s).
However, if I just mechanically change the timing of inlfaiton one period back (to period t where it is supposed to be t+1), the code works.
I’m a bit puzzled now - could you see any obvious problem in my code? Could the reason be that the retail sector is missing? Impulse responses are also somehow weird - following a contractionary monetary policy shock both output and Inflation for some reason increase on Impact. I have the feeling that there is some fundamental issue in my code, but I cannot see now what it could be.
I would appreciate if you could have a look on my modified code!
replication.mod (5.12 KB)
This sounds like a timing problem. You cannot set inflation as predetermined. This makes no sense as you are saying that inflation cannot react within this period to e.g. monetary policy.
You says you consider flexible prices. If that is true, why should output move after a monetary policy shock in your model? Note also that Dynare says something about the rank condition not being satisfied. It could be that when you use flexible prices that some variables cannot be determined, i.e. the flex-price version is not easily nested in your model because some equations and variables would completely drop out, leading to singularity.
I have introduced a variation (GHH preferences) in my code (that it is working for the benchmark case, thanks to this forum help!). Now, I get the error “The steady state file did not compute the steady state”.
The utility function I use in the GHH version is U(c,1-n)=(c_t-lamn_t^mu)^the /the*.
The unique modifications I introduce in the code are the substitution of the Marginal Utility of c and the substitution of the F.O.C. of n (labor). The model uses these new equations when you change the value of parameter lam from 0 (default version) to a positive number (I was trying lam=8 and muH=1.4).
Indeed, the equations with residuals are these two: 12 and 13 (and others depending on them). I am convinced they are correctly specified. I checked that lam and mu have the correct (and equal) value over the running process (so steady state files are uploading the parameters correctly.
Should the model equations suffer from any other modification?
Where could my error be?
The running file is called Quality_run.m. The model is in dyn_main.mod. Equation 12 in dyn_main.mod is found (for the steady state computations) in sseqs.m line 88 and equation 13 in dyn_det.m in line 47. They are also in sseqs_try.m and dyn_det_try.m because I needed to compute the steady state beforehand to obtain a pair of values (of steady state prices) that must be used in running the model.
Your help/advise is so welcome. Thank you!
quality_works_notforGHH.zip (20.2 KB)
I am not sure I get what the exact problem is. Generally, changing preferences will affect all steady state values.So you have to go through all computations again.
Thank you for answering.
Of course, you’re right. But, in the code, I defined Uc (marginal utility of consumption) and the F.O.C. of labor for the two versions (two types of preferences). The rest of equations linked to them are expressed in terms of those two without substitution (e.g. you find Uc in equations 15, 16… and, therefore, these equations are also changing for the two versions).
The code works find for standard preferences (that are “run” when lam is stated to 0). It fails when you try lam>0 (which activates GHH version)…
When you run the code (with e.g. lam=8, mu=1.4), the first part that is called is the external steady state block (steadystate_matlab_try.m, dyn_det_try.m, sseqs_try.m, psinv_try.m). It runs, but the resulting steady state is clearly wrong…
Then, dyn_main.mod is called and, it stops when it gets to “steady” part. This part calls dyn_main_steadystate.m (and dyn_det.m, sseqs_m, psinv.m).
I don’t know why it is not working…
I discovered the problem comes from the combination of values assigned to mu and lam. If the pair is not “suitable” I may get 0 or negative labor supply, so the code crashes. Thank you for your answer and sorry for the nuisance.