Would appreciate your help in solving Steady State error. I am estimating Mendoza’s Sudden Stop model (attached SS.mod). I have used 2 different external file for estimating the steady state (SS_steadystate.m is one of them and attached too). However, dynare returns steady state related error “Too many input arguments”. Also how can I avoid this problem in the future?

Much appreciated prof.
I have amended the external Steady State file based on attachment you provided (attached).However, If I managed to solve for some of the equations and 2-3 equations left out without an analytical steady state solution due to high nonlinearity. Can then dynare solve for the rest of the steady state variables ? If yes, as I see from previous discussions, then how to do it and should I impose initial values for these unsolved variables ? (I am new to dynare so excuse me for repeating myself over the same issue and thanks a million)Mendoza.mod (2.7 KB) Mendoza_steadystate.m (2.3 KB)

I am not sure what your are doing. There are obvious typos in your steady state file. In

lambda(1-Z*R)=mu;

there is a sign missing before the bracket.
Regarding your question: you can call a solver within the steady state file to deal with the remaining nonlinear equations.

Dear Prof.
Thank you for the update. Yes, this a typo and it should be lambda*(1-Z*R)=mu instead. I will go over the SS block again for double check since when tried to solve it using fsolve matlab function it returned complex numbers solution. I will use the NK_baseline_steadystate and revert if the issue persists.

dyn_main_steadystate.m (2.7 KB)
Dear Johannes,
I am trying to update my code to be used with Dynare 4.6.x but I’m messing up with my steady state file… I don’t know how to adapt it correctly. May you help me, please? I was trying to follow BreakingFeaturesIn4.6.
Thanks

dyn_main.mod (11.7 KB) dyn_main_steadystate.m (3.2 KB)
Johannes,
You’re right. Sorry. I should have explored the example better before asking in the forum.
I upload now the new steadystate file and the main mod-file. I get a new error saying

Error using eval
Undefined function or variable 'c'.

I have a two-country model and I have c@, which takes name cH and cF. May the problem come from this fact? How could I make the steady state file account for it?
You may notice that, compared to the example, I changed {} by () because I was getting another error: Brace indexing is not supported for variables of this type. Can I safely do this change?

The full error I get is:

Error using eval
Undefined function or variable ‘c’.

v7justq.rar (20.2 KB)
Ok. Thank you… I deleted the M_ structure loading and retook the correct file you provided me.
The attachment contains all code files.

Many thanks, Johannes. Yesterday, it did not work in my laptop. It worked today in my PC… I don’t understand what I did wrong (once I used the file you uploaded).

I reinstalled dynare in my laptop and cleanned Matlab path and now it works, but I cannot remember the details of the error. It was an error regarding ‘c’ having to be a string scalar or character vector.
We have a two-country model and we define c@, which takes names cH and cF.

One last thing that may be connected to the new Dynare version (sorry!):
I get a new error if I run the code from dyn_calibration.m (included in the .rar):

Dot indexing is not supported for variables of this type.
Error in dyn_sssim (line 20)
num2cell(oo_.steady_state),...
Error in dyn_stats_qadj (line 12)
SS = dyn_sssim(M_,options_,oo_,'ss');
Error in dyn_calibration (line 10)
[newss, ssH, ssF, stdH, stdF, acrH, acrF, corH, corF, corHF] =
dyn_stats_qadj(M_,oo_,oo_sim);

If I substitute () by {} I get:

Undefined function or variable 'num2cell'.
Error in dyn_sssim (line 20)
SS=dyn_sssim(M_,options_,oo_,'ss');

I’m getting crazy… Now it’s working for me too. No clue what was happening… dyn_calibration has the call to dyn_stats_qadj commented. I (un)comment line 9 or 10 to run one version or the other.
Thanks…

Dear all,
As it happened to me with another code (see above in this topic), I think I am not setting the steady state file correctly for the updated dynare.
I changed the header and footer of my steady state file following the link Johannes kindly indicated in his answer (Nov '20) but I get, once more, this error:

Error using eval
Undefined function or variable ‘rH’.
Error in dyn_main_steadystate (line 63)
eval([‘ys(’ int2str(ii) ') = ’ varname ‘;’]);
Error in evaluate_steady_state_file (line 49)
[ys,params1,check] = h_steadystate(ys_init,
exo_ss,M,options);
Error in evaluate_steady_state (line 210)
[ys,params,info] =
evaluate_steady_state_file(ys_init,exo_ss,M,
options,steadystate_check_flag);
Error in steady_ (line 55)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 80)
[oo_.steady_state,M_.params,info] =
steady_(M_,options_,oo_);
Error in dyn_main.driver (line 605)
steady;
Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;
Error in dyn_table (line 7)
dynare dyn_main.mod