Page 1 of 1

error in mod file of risk shocks (2014, AER)

PostPosted: Fri Aug 26, 2016 3:35 pm
by HouseC
Dear all,

While I'm trying to run the main file of “Risk Shocks” by Christiano, Motto and Rostagno (2014,AER). Dynare returns error message.
For the mod file, it's available at the AER website: https://www.aeaweb.org/aer/data/jan2014 ... 2_data.zip
The main file is within the subfolder: cmrfiles\figure1.
My dynare version is 4.4.3. The error message is:
The posterior mode file cmr_mode has been generated using another specification of the model or another model!
--> Estimated parameter iota_p is not present in the loaded mode file.
--> Estimated parameter iotaw_p is not present in the loaded mode file.
--> Estimated parameter signal_corr_p is not present in the loaded mode file.
--> Estimated parameter stdsigma2_p is not present in the loaded mode file.
--> Estimated parameter stdsigma1_p is not present in the loaded mode file.
Error using dynare_estimation_init (line 234)
Please change the mode_file option, the list of estimated parameters or
set mode_compute>0.


When I search for this issue. I find that Professor Johannes Pfeifer mentioned this issue at https://github.com/DynareTeam/dynare/issues/519
I add the codes before "estimation" in the main mod file. After the modification, steady state is solved and rank conditions are satisfied. Yet, the error message change as the following:

Loading 118 observations from data_BAAoverTB.mat

Reference to non-existent field 'nvn_observable_correspondence'.
Error in set_all_parameters (line 78)
k = estim_params.nvn_observable_correspondence(i,1);
Error in check_for_calibrated_covariances (line 38)
M = set_all_parameters(xparam1,estim_params,M);
Error in dynare_estimation_1 (line 89)
estim_params_=check_for_calibrated_covariances(xparam1,estim_params_,M_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in cmr (line 3085)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;


I try to run the mod file using unstable dynare version, and the error message is still there.

I want to know, is there any stable dynare version that could successfully run this code? Or how to solve the error displayed above.

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Sun Aug 28, 2016 3:17 pm
by HouseC
Anyone could help?

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Mon Aug 29, 2016 6:31 am
by jpfeifer
Please provide the files.

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Tue Aug 30, 2016 4:40 am
by HouseC
jpfeifer wrote:Please provide the files.


Dear Johannes,
Thanks for your reply.
Please find the attached file, which is downloaded from AER website.
I simply run "dynare cmr.mod" within in the subfolder "figure1".
And dynare return error message on "cmr_mode". Then I follow your suggestion in Github and add the following codes in the main mod file, just before the estimation command.
Code: Select all
load cmr_mode
parameter_names(strcmp('iota1_p',parameter_names),:) = {'iota_p'};
parameter_names(strcmp('iotaw1_p',parameter_names),:) = {'iotaw_p'};
parameter_names(strcmp('stdsigmax_p',parameter_names),:) = {'stdsigma2_p'};
parameter_names(strcmp('stdsigma_p',parameter_names),:) = {'stdsigma1_p'};
parameter_names(strcmp('par8_p',parameter_names),:) = {'signal_corr_p'};
save cmr_mode xparam1 hh parameter_names


After the modification, I was stuck by the error message mentioned above.
Best,
Sihao

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Fri Sep 02, 2016 3:29 am
by HouseC
Dynare version 4.3.2. is fine to run the code.
Anyone has suggestion to modify the code to such that updated Dynare version (4.4.3) could compile?

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Sat Sep 03, 2016 9:43 am
by jpfeifer
Due to the changes CMR did in
Code: Select all
mrfiles\dynare_code

their code is only compatible with Dynare 4.3.2, not Dynare 4.4. Circumventing this is challenging. If you don't want to re-estimate the model, you might be able to use the version in the Macro Model Database.

Re: error in mod file of risk shocks (2014, AER)

PostPosted: Sat Sep 03, 2016 12:41 pm
by HouseC
jpfeifer wrote:Due to the changes CMR did in
Code: Select all
mrfiles\dynare_code

their code is only compatible with Dynare 4.3.2, not Dynare 4.4. Circumventing this is challenging. If you don't want to re-estimate the model, you might be able to use the version in the Macro Model Database.


Thanks for your reply, Johannes!