Page 1 of 1

MCMC Diagnostics on estimated DSGE model

PostPosted: Tue Sep 30, 2014 8:09 am
by hanz
Hi,
I encountered unexpected results from MCMC diagnostic - the diagnostics change historically when mh_drop is changed.

What I did & the results:
1) I estimated a model on 2M replications and got kolasa8_mdiag (multivariate) diagnostics file (mh_drop=0.80)
2) I loaded samples (load_mh_file), added 40,000 more samples and did the diagnostics again (this time with mh_drop=0.9) and got kolasa8_mdiag_new file.

As you can see, the diagnostics changed even for the samples that stayed the same (most notably, for samples from 0-1M).

Are the diagnostics computed correctly? If so, what is the interpretation? The horizontal axis suggests that the results of the diagnostics are for the total number of replications, so how it can be affected by the portiond of draws I drop?

(The diagnostics are computed only for 100 points - I checked that this is not a problem by calculating the results for 1000 points. And yes, the same problem holds for multivariate and univariate diagnostics.)

The diagnostics EPS are zipped because The extension eps is not allowed.

edit: If you want to look into the files, I believe I know where the problematic part is, but I don't understand the programming....
File: McMCDiagnostics.m
lines (dynare 4.4.3): 350, 356, 357,...
Code: Select all
    linea = ceil(options_.mh_drop*iter);
    temp  = tmp(find((tmp(:,3)>=linea) & (tmp(:,3)<=iter)),1:2);
    MDIAG(ligne,1) = temp(CSUP,1)-temp(CINF,1);

Re: MCMC Diagnostics on estimated DSGE model

PostPosted: Tue Oct 07, 2014 5:55 am
by hanz
It's been a week with no reply. Johannes Pfeifer, you seem to reply to most of the post in this forum, do you have any advice for me?

Re: MCMC Diagnostics on estimated DSGE model

PostPosted: Tue Oct 07, 2014 8:13 am
by jpfeifer
I am working on it, but I am busy and, as you may have noticed yourself, this is not the most intuitive part of the code. It seems to be related to the fact that the graphs are generated by averaging over different window lengths when you add draws. This affects the whole line.

Re: MCMC Diagnostics on estimated DSGE model

PostPosted: Thu Oct 09, 2014 9:21 am
by jpfeifer
Ok, here is the answer. As documented in Brooks/Gelman(1998), the graphs are derived from dividing the sample into batches and, within each window that includes draws up to the current batch by dropping half of the draws (a type of thinning, see pages 438/39). That is where the mh_drop comes in. When you now add draws, what happens is the the window size changes over which the statistic is computed and the that within each window, different draws are now dropped. This leads to the change in all draws reported.