"syntax error, unexpected NAME" when computing the steady state

Dear Professor Pfeifer,

I am new to dynare and am trying to replicate results from an article of Bilbiie, Ghironi and Melitz (2012) called “Endogenous Entry, Product Variety, and Business Cycles”. For this I have found another topic on this forum with a .mod file that was helpful, but gave different results than those found in the paper. I have also found a .mod file on Github that is supposed to give the right results but I cannot seem to make it work.

So, I am trying to learn from both of these files to create my own script. My goal is to modify the Github file I found by adding a steady_state_model block so that I don’t need another file to compute the simulations. So, I copied the value of the steady state I found in the matrix file and put them below the steady_state_model command, but it doesn’t work. I get an error message saying “ERROR: BGMYo.mod: line 154, col 51: syntax error, unexpected NAME”.

Where is this error coming from (I already tried to modify the values so that there is not the “+[…]i” after the value, but it still doesn’t work) ? Also, could anyone explain why the original script does not work for me please ? Do I have to update it for the last version of dynare ? Thanks in advance ! Also, sorry for the naive questions !

Here is my modified file : BGMYo.mod (5.3 KB)
Based on this script I found : BGM_2012.mod (4.7 KB)

  • I would have put the link to the article in question but I am limited to two links only.

Why is your steady state complex? And did you see Replication codes for papers with equity premia!

Thank you for your response ! I actually don’t know why my steady state was complex… I found the values inside the steadystate_initial_values matrix from the original code. I did look at the topic you mentioned and used it to do my simulations, but the irfs I get from it are not exactly the ones of the paper (although their shapes are quite close). Also, it lacks the distinction between the translog case and the CES case, and does not treat all the variables I’m looking for (9 instead of 15 in the paper). As I found this other script (BGM_2012.mod) that apparently exactly replicates the simulations, I was wondering why I could not get it to work on my computer. Could you maybe have a look at this script just to know if it’s a compatibility problem with the new version of dynare or if there is something inherently wrong with it ? Here is the message I get when trying to run it :

Error using BGM_2012_steadystate
Too many input arguments.

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 BGM_2012.driver (line 354)
steady;

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

I was also wondering if it was possible to modify this script so that I can use the steady_state_model block and not call a function. I thought I could do this by adding initial values that I found in the matrix I mentioned earlier in the steady_state_model block, but apparently I was wrong. Once again, I apologize if these questions are naive or obvious, as I’m all new to dynare. Thanks again and have a great day !

You did not provide the files.

I thought I uploaded them in my initial post ? The script that gives me the error message is this one : BGM_2012.mod (4.7 KB)

I meant the steady state file.

I’m so sorry ! Here it is : BGM_2012_steadystate.m (4.5 KB)

I hope this is it, please excuse my ignorance…

The following files should work from Dynare 4.6 :BGM_2012.mod (4.7 KB) BGM_2012_steadystate.m (4.1 KB)

Please let me know whether they indeed replicate the original results.

Thank you so much professor, it works ! I’ll look at the changes you made to understand it better !

See Code not working after updating Dynare to 4.6.0 - #2 by stepan-a