find the mode

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

find the mode

Postby ZBCPA » Tue Jun 23, 2015 4:22 am

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.

Thanks
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: find the mode

Postby jpfeifer » Thu Jun 25, 2015 6:17 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: find the mode

Postby ZBCPA » Sun Sep 06, 2015 4:24 am

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,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: find the mode

Postby jpfeifer » Sun Sep 06, 2015 8:08 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: find the mode

Postby ZBCPA » Sun Sep 06, 2015 11:11 am

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 "[b]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
estimation(datafile=data_argentina,
xls_range=G2:J107,
logdata,//data is already logged, loglinear option would otherwise log the data
mode_compute=6,
moments_varendo,
mh_nblocks=1,
mh_replic=0,
mode_check);

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,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: find the mode

Postby jpfeifer » Sun Sep 13, 2015 4:01 pm

------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 9 guests