Looping over hyperparameters in Bayesian VAR

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.

Looping over hyperparameters in Bayesian VAR

Postby gcandian » Thu Oct 08, 2015 3:43 pm

Hello,

I would like to estimate a Bayesian VAR in Dynare several times, looping over possible combination of hyper-parameters values. My current mod file looks like this:

var pih pif yhg yfg;
varobs pih pif yhg yfg;

bvar_density(datafile = dataset, first_obs = 6,
bvar_prior_mu = 2, bvar_prior_lambda = 1, bvar_prior_tau = 1,
bvar_prior_decay = 4, bvar_prior_omega = 1) 4;

Is there a simple way of defining the values for mu, lambda, tau, d and omega outside the mod file and then pass them in?
Also, where is the value of the marginal data density stored?
Thank you very much!

Giacomo
gcandian
 
Posts: 7
Joined: Sat Aug 09, 2014 10:39 pm

Re: Looping over hyperparameters in Bayesian VAR

Postby jpfeifer » Sat Oct 10, 2015 4:00 pm

Could you please provide me with the full codes.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Looping over hyperparameters in Bayesian VAR

Postby gcandian » Sat Oct 10, 2015 9:18 pm

Hi Johannes,

The code I posted is my full mod file. I basically want to find the values of the hyper parameters mu, lambda, tau, decay and omega that maximize the marginal data density (MDD). To do that I would need to know how to pass the parameter values from an .m file into the .mod file and know where the value of the MDD is stored so that I can write the maximization routine in my .m file outside of dynare.

Thanks,

Giacomo
BVAR.mod
(251 Bytes) Downloaded 148 times
gcandian
 
Posts: 7
Joined: Sat Aug 09, 2014 10:39 pm

Re: Looping over hyperparameters in Bayesian VAR

Postby jpfeifer » Wed Oct 14, 2015 5:47 pm

The datafile is missing.
It seems you need to loop over
Code: Select all
options_.bvar_prior_decay = 4;
options_.bvar_prior_lambda = 1;
options_.bvar_prior_mu = 2;
options_.bvar_prior_omega = 1;
options_.bvar_prior_tau = 1;

The problem seems to be that the MDD is not stored. We are working on it: https://github.com/DynareTeam/dynare/issues/1090
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 9 guests