Page 1 of 1

Looping over hyperparameters in Bayesian VAR

PostPosted: Thu Oct 08, 2015 3:43 pm
by gcandian
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

Re: Looping over hyperparameters in Bayesian VAR

PostPosted: Sat Oct 10, 2015 4:00 pm
by jpfeifer
Could you please provide me with the full codes.

Re: Looping over hyperparameters in Bayesian VAR

PostPosted: Sat Oct 10, 2015 9:18 pm
by gcandian
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

Re: Looping over hyperparameters in Bayesian VAR

PostPosted: Wed Oct 14, 2015 5:47 pm
by jpfeifer
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