recovering MH diagnostic

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.

recovering MH diagnostic

Postby tovonony » Thu Sep 13, 2012 9:43 am

Hello,
Is it possible to recover the Metropolis Hasting diagnostic check graphs after Matlab has been closed?
I do not want to re-run the estimation because it takes many hours.
If there is a mean to re-run theses diagnostics without running estimation, it would be perfect.
Thanks for any helps!!!
Tovonony
tovonony
 
Posts: 15
Joined: Mon May 31, 2010 10:02 am

Re: recovering MH diagnostic

Postby peter487 » Thu Sep 13, 2012 3:34 pm

Run your model again but change your estimation command to include:
Code: Select all
estimation(mh_replic=0, load_mh_file);

It tells Dynare not to run Metropolis-Hasting again, but to use previously generated files. After it is finished run:
Code: Select all
McMCDiagnostics(options_, estim_params_, M_)

This will reproduce MH diagnostics graphs.
peter487
 
Posts: 14
Joined: Thu Sep 13, 2012 3:26 pm

Re: recovering MH diagnostic

Postby tovonony » Thu Sep 13, 2012 7:28 pm

thanks a lot Peter487,
In fact, i had the following code
Code: Select all
estimation(datafile=data_cpi_ols,mh_replic=200000,mh_nblocks=5,mh_drop=0.45,mh_jscale=0.7,mode_file=erpt_mode,mode_compute=6,smoother)

So you mean that i have to re-run the model with the following estimation block
Code: Select all
estimation(datafile=data_cpi_ols,mh_replic=0,mh_nblocks=5,mh_drop=0.45,mh_jscale=0.7,mode_file=erpt_mode,mode_compute=6,load_mh_file,smoother)

or simply
Code: Select all
estimation(mh_replic=0, load_mh_file);

Moreover, do you know how to get the entire sequence of the parameters generated by the MH?
Thanks again,
Tovonony
tovonony
 
Posts: 15
Joined: Mon May 31, 2010 10:02 am

Re: recovering MH diagnostic

Postby peter487 » Thu Sep 13, 2012 8:26 pm

Yes run it with
Code: Select all
estimation(datafile=data_cpi_ols,mh_replic=0,mh_nblocks=5,mh_drop=0.45,mh_jscale=0.7,mode_file=erpt_mode,mode_compute=6,load_mh_file,smoother)

However you can also skip mode compute as you already have it (handle with care)
Code: Select all
estimation(datafile=data_cpi_ols,mh_replic=0,mh_nblocks=5,mh_drop=0.45,mh_jscale=0.7,mode_file=erpt_mode,mode_compute=0,load_mh_file,smoother)

Moreover, do you know how to get the entire sequence of the parameters generated by the MH?

I'm not really sure what you mean, but you can find values generated by MH in the folder yourmodelname/metropolis/
peter487
 
Posts: 14
Joined: Thu Sep 13, 2012 3:26 pm

Re: recovering MH diagnostic

Postby tovonony » Thu Sep 13, 2012 9:02 pm

ok, many thanks!!!
tovonony
 
Posts: 15
Joined: Mon May 31, 2010 10:02 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests