Page 1 of 1

recovering MH diagnostic

PostPosted: Thu Sep 13, 2012 9:43 am
by tovonony
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

Re: recovering MH diagnostic

PostPosted: Thu Sep 13, 2012 3:34 pm
by peter487
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.

Re: recovering MH diagnostic

PostPosted: Thu Sep 13, 2012 7:28 pm
by tovonony
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

Re: recovering MH diagnostic

PostPosted: Thu Sep 13, 2012 8:26 pm
by peter487
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/

Re: recovering MH diagnostic

PostPosted: Thu Sep 13, 2012 9:02 pm
by tovonony
ok, many thanks!!!