Questions in the replication of Fernandez-Villaverde (2006)

Dear Johannes,

Thank you very much for the reply. My original error disappeared. Now two new problems concerning the steady state file arise.

  1. When I run my code using the unstable version of Dynare (2014-07-03), I got the following error:

Error using print_info (line 80)
The steady state contains NaN or Inf

Error in print_info (line 80)
error(‘The steady state contains NaN or Inf’)

Error in initial_estimation_checks (line 98)
print_info(info, DynareOptions.noprint, DynareOptions)

Error in dynare_estimation_1 (line 170)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in CN_P1_std (line 508)
dynare_estimation(var_list_);

Error in dynare (line 185)
evalin(‘base’,fname) ;

When I change to the stable version (Dynare 4.4.2), I got the following error:

Error using print_info (line 72)
The steadystate file did not compute the steady state

Error in print_info (line 72)
error(‘The steadystate file did not compute the steady state’)

Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint, DynareOptions)

Error in dynare_estimation_1 (line 179)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in CN_P1_std (line 504)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin(‘base’,fname) ;

I am not sure if this a bug or there are still problems in my code. The files are attached for your reference. By the way, I have tried stoch_simul using the same code, it worked. When I change to estimation, the error arises.

  1. I previously wrote the ending block of the steady state file following NK_baseline_steadystate in the example folder of unstable Dynare. But it did not work. Then I searched the forum and found a file you provided in an earlier post, called SOE_steadystate. I modified mine accoring to this one and it worked (at least for my stoch_simul). As I have a linear model, the same as the case in this post (External MATLAB function in Dynare). So I think it is helpful. I am just curious if there is a complete and formal guideline for writing the beginning and ending blocks of the steady state file. Or if you may provide a few example files containing different scenarios (linear versus nonlinear models), that will be very helpful and will reduce people’s potential confusion in the future. For your reference, I also attached the SOE.mod and SOE_steadystate.m.

Thank you again for your kind help!

Best,

Bing
SOE_steadystate.m (4.87 KB)
SOE.mod (7.19 KB)
myexample.xls (14.2 KB)
myexample_steadystate.m (5.96 KB)
myexample.mod (15.1 KB)