Find the mode

Dear Johannes Pfeifer,

Could I ask two questions?

Q1: What is the difference between the mode after “MCMC” and the mode after “mode finding”?

Q2: When I do bayesian estimation, I first use (mode_compute=6, mh_replic=0)to get the mode finding results, then set them as initial values of Priors by hand, like(stderr ep, 0.0023,inv_gamma_pdf,0.01,inf;) to run (mode_compute=4, mh_replic=20000) . If the mode value I get after mode finding are the same as the initial values , then I assume I have found the mode. Is that right? what is the difference between this method and “using mode_file option” method?

Any help will be appreciated.


Q1. Ideally, they are (almost) the same. The one after mode-finding should be the highest posterior density point. The MCMC should then survey the region around this mode. If the two are very different, you usually did not find the correct mode initially and the MCMC moved to a more likely parameter region.

Q2. What you describe is wrong. You must not use the data to construct your prior! If you want to use several mode finders in sequence, you should use the mode-file option to provide your previous results.

Dear Johannes Pfeifer,

Many thanks for your reply.

In terms of the second answer, I am a little confused.

Because I do not use data to set prior in the example I gave. What I do is to set like(rhog, , , ,beta_pdf,0.5,0.2; after run mode_compute=6 , I got the mode result like 0.8867, then I set 0.8867 to be initial value to run mode_compute=6 again(rhog, 0.8867, , ,beta_pdf,0.5,0.2;). if the mode does not change much ,then I run mode_compute=4(rhog, 0.8867, , ,beta_pdf,0.5,0.2;), finally check the “mode check plot” figures to if this is a good mode.
I am just wondering if this is a right waym to set initial value and find mode?

Best regards,

Dear Huan,

it initially sounded like you were setting the prior mean according to the first run of the optimizer. What you describe now (setting just the initial value) is fine and should work. If the mode_check plots look good, everything is fine.

Dear Johannes Pfeifer,

Thank you very much! Sorry for my poor English making you confused.

Could I ask one more question?

I am learning your dynare code of “**Real business cycles in emerging countries”. I find that you directly “Use their posterior as starting values for estimation”.

If I delete estimated_params_init(use_calibration) and do not specify any initial values, so to use the prior mean(priors are same as yours) as starting values, and then run
logdata,//data is already logged, loglinear option would otherwise log the data

I can not get similar estimation results with yours in terms of the mode found. Then I use “mode_file=mycode_mode” option to run mode_compute=6 many times, the results are still far from correct(persistence of shocks are all almost 0.99). Before I find a reasonable mode, I do not start MCMC.

I am just wondering how to get a similar estimation results of posterior mean without using any posterior information in the paper? Could you give me some hints?

Thanks in advance.

Best regards,

See [Real business cycles in emerging countries)