Gibbs sampling


For large models, Metropolis-Hastings alone may not be as efficient as it would, combined with Gibbs sampling. The following files permit the use of Gibbs sampling within MH.

To use, copy the four files on your path and, in your mod-file, add the options:

options_.posterior_sampling_method = 'gibbs_random_walk_metropolis_hastings';


options_.posterior_sampling_method = ' gibbs_independent_metropolis_hastings';


options_.gibbs =  [ones(25,1) ; zeros(75,1)] [zeros(25,1) ; ones(25,1) ; zeros(50,1)]  [zeros(50,1) ; ones(25,1) ; zeros(25,1)] [zeros(75,1) ; ones(25,1)] ];

This example is for 100 parameters estimated in 4 sample blocks. The ones and the zeros tell the code which block and when. You can put a different number than one to modify the jscale for that block only (it will be multiplied with the original jscale).

Hope this is useful
gibbs_random_walk_metropolis_hastings_core.m (12.2 KB)
gibbs_random_walk_metropolis_hastings.m (6.88 KB)
gibbs_independent_metropolis_hastings_core.m (9.88 KB)
gibbs_independent_metropolis_hastings.m (5.37 KB)

Thank you for this m file
please let me know the reference papers for the Gibbs sampling within MH.
and is it possible to use the m files for DSGE model??


Sorry for the really late reply, you can look at this:


Dear Gbel or others,
do you have an updated version of this code that is adapted to new Dynare versions ?
Is there another way to compute Gibbs sampling through Dynare ?