Help with Code Modification and File Regeneration

Hi,

I am a newcomer trying to replicate a research paper’s code(RBC_q0.mod). I encountered an issue while attempting to correct a discrepancy in the code (RBC_q0_new.mod). Specifically, I added a term varrho(+1) at the end of line 134 and added a corresponding line at 135. Additionally, I made adjustments in the steady state equations at line 240 and rewrote line 241 accordingly.

However, upon running the updated code, I encountered the following error message: “There are 21 eigenvalue(s) larger than 1 in modulus for 19 forward-looking variable(s). The rank condition ISN’T verified!” I am unsure how to resolve this issue. Could you kindly provide some guidance on how to address it?

Furthermore, I would like to inquire about the generation of the files RBC_q0_mean.mat, RBC_q0_mh_mode.mat, RBC_q0_mode.mat, RBC_q0_params.mat, and RBC_q0_results.mat. After making modifications to the original code, how can I regenerate these files? For instance, if my modified .mod file is named RBC_q0_new.mode, I attempted to modify the code as follows:

matlab
Copy code
estimation(
order=1,
datafile=‘dataNZ_cubic_trend.m’,
presample=29,
first_obs=1,
prefilter=1,
plot_priors=0,
lik_init=2,
mh_nblocks=4,
mh_jscale=0.38,
% mode_compute=5,
mh_replic=00000,
mode_compute=0,
mode_file=RBC_q0_new_mode,
% load_mh_file,
% mh_drop=.1,
% load_results_after_load_mh,
% nodiagnostic,
% posterior_nograph
% bayesian_irf,
% irf=20,
mh_conf_sig=0.90,
conf_sig=0.90
);

Could you please advise if my approach is correct? Also, how can I regenerate the load_mh_file?

I would greatly appreciate any assistance you could provide.

Best regards,
Taylor

dataNZ_cubic_trend.m (16.8 KB)
RBC_q0.log (7.8 KB)
RBC_q0.mod (11.5 KB)
RBC_q0_mean.mat (8.0 KB)
RBC_q0_mh_mode.mat (4.4 KB)
RBC_q0_mode.mat (4.3 KB)
RBC_q0_new.log (7.8 KB)
RBC_q0_new.mod (11.6 KB)
RBC_q0_params.mat (205 Bytes)
RBC_q0_results.mat (494.5 KB)

  1. The Blanchard-Kahn violation suggests a timing error or other mistake in the code.
  2. The files you mention will be generated when you run estimation with mode finding and mh_replic bigger than the current 0.

Thank you for the advice, Professor! It is very helpful!

Best,
Yan

Hi Professor,

I ran the attached code and encountered an error stating, “There are 21 eigenvalues larger than 1 in modulus for 20 forward-looking variables. The rank condition ISN’T verified!” Subsequently, I ran model diagnostics and found that “MODEL_DIAGNOSTICS: The Hessian of the dynamic model contains Inf or NaN.”

Could you please advise on how to resolve this error?

Thank you so much!

Best,
Yan

par1.mat (7.2 KB)
console0412.m (15.0 KB)
cbdc0412_3.mod (29.2 KB)
find_steady_par_Yan.m (1.4 KB)

Hi Professor,

I managed to update the mode file, but I’m still encountering issues: Dynare cannot compute the steady state with the initial parameters. The version of Dynare I am using is Dynare 5.4. The model diagnostic indicates, “No obvious problems with this mod-file were detected.” Could you please advise? I have attached the updated files for your reference.

Thank you!

Best,
Yan
par1.mat (7.2 KB)
console0412.m (15.1 KB)
cbdc0412_3.mod (29.4 KB)
cbdc0412_3.log (7.7 KB)
dataNZ_cubic_trend.m (16.8 KB)
find_steady_par_Yan.m (1.4 KB)