Gibbs sampling

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.

Gibbs sampling

Postby gbel » Wed May 04, 2011 8:20 pm

Hi,

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:
Code: Select all
options_.posterior_sampling_method = 'gibbs_random_walk_metropolis_hastings';

or
Code: Select all
options_.posterior_sampling_method = ' gibbs_independent_metropolis_hastings';

and
Code: Select all
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
Gilles
Attachments
gibbs_random_walk_metropolis_hastings_core.m
(12.2 KiB) Downloaded 248 times
gibbs_random_walk_metropolis_hastings.m
(6.88 KiB) Downloaded 279 times
gibbs_independent_metropolis_hastings_core.m
(9.88 KiB) Downloaded 230 times
gibbs_independent_metropolis_hastings.m
(5.37 KiB) Downloaded 286 times
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Re: Gibbs sampling

Postby alwaysbok » Tue Jan 03, 2012 10:50 am

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??
wjm
alwaysbok
 
Posts: 1
Joined: Mon Jul 09, 2007 9:17 pm
Location: seoul , korea

Re: Gibbs sampling

Postby gbel » Tue Jun 05, 2012 7:42 pm

Hi,

Sorry for the really late reply, you can look at this:
Code: Select all
http://www.dynare.org/events/paris-1005/dynare-lectures-zha.pdf


Gilles
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Re: Gibbs sampling

Postby jonathanb » Sun Aug 24, 2014 8:43 am

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 ?
Best,
Jonathan
jonathanb
 
Posts: 54
Joined: Wed Sep 17, 2008 8:52 pm
Location: New York


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 1 guest