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

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: 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 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.

Anyone could help?

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.

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

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?

Due to the changes CMR did in

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.

[quote=“jpfeifer”]Due to the changes CMR did in

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.[/quote]

Thanks for your reply, Johannes!

Dear all,

This is just a follow up message for anyone that can encounter the same problems as above. As noted by Johannes in order to use the codes of CMR(2014), available at the AER CMR(2014), we should run the next codes before using Dynare due to the differences in some variable names in the mode file (and in the model):

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

Also note that the latest Dynare release (4.5.4) allows the definition of the Weibull distribution as a prior. Therefore we do not need the “modified Dynare files” of CMR. To discard the use of these files, we have to comment out in the “cmr.mod” file the next command: “%addpath(’…/…/dynare_code’);” . Also, we should change the prior of the net worth to “Weibull_pdf” in the file “cmr_estimated_params.mod”. Making these changes the code runs perfectly. Please let me know if you have any questions. I hope this could help you in some way.