DSGE VAR example bvar_forward.mod falls over at IRFs

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.

DSGE VAR example bvar_forward.mod falls over at IRFs

Postby christierbnz » Thu Mar 12, 2009 8:27 am

Hi,
I am having trouble running the bvar_forward.mod example from http://www.dynare.org/DynareWiki/DsgeVar (eg see http://www.dynare.org/DynareWiki/DsgeVar?action=AttachFile&do=get&target=bvar_forward.mod).

estimation(datafile=datarabanal_hybrid,first_obs=50,mh_nblocks = 1,nobs=90,mode_compute=4,mh_replic=20000)

runs correctly.

But

estimation(datafile=datarabanal_hybrid,first_obs=50,mh_nblocks = 1,nobs=90,mode_compute=4,mh_replic=20000,bayesian_irf)

does not.

The file successfully computes the posterior distributions using the Metropolis-Hastings algorithm, but then fails to compute the impulse responses and results in the following error message:

MH: Posterior (dsge) IRFs...
MH: Posterior (bvar-dsge) IRFs...
??? Index exceeds matrix dimensions.

Error in ==> PosteriorIRF at 366
[MeanIRFdsgevar(kk,j,i),MedianIRFdsgevar(kk,j,i),VarIRFdsgevar(kk,j,i),...

Error in ==> dynare_estimation at 943
PosteriorIRF('posterior');

Error in ==> bvar_forward at 172
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin('base',fname) ;

A different model crashes in the same place.

I am running dynare 4.0.2 from a network drive: h:\matlav\dynare\4.0.2.

Regards,
Christie
christierbnz
 
Posts: 1
Joined: Tue Mar 10, 2009 7:54 am

Re: DSGE VAR example bvar_forward.mod falls over at IRFs

Postby StephaneAdjemian » Thu May 14, 2009 10:22 am

Dear Christie,

The problem is specific to this version of Dynare (I did run successfully the mod file using the snapshot, I did not try with dynare version 4.0.3).

The problem is that in this example I did not declare a set of variables after the estimation command for which I want to see posterior IRFs. In this case dynare (4.0.2) prints:

Code: Select all

You did not declare endogenous variables after the estimation command.
Posterior IRFs will be computed for the 10 endogenous variables
of your model, this can be very long....
 
 
Choose one of the following options:
 
 [1] Consider all the endogenous variables.
 [2] Consider all the observed endogenous variables.
 [3] Stop Dynare and change the mod file.
 
options [default is 1] = 



If you choose the first option (the default), Dynare will try to compute the IRFs for all the endogenous variables of the DSGE model... But this is meaningless for a VAR model, where the IRFs can only be computed for the observed variables. So you have to choose the second option in this case.

With more recent versions of Dynare, if a subset of variables is not listed after the estimation command and if you estimate a Dsge-Var model Dynare understands that you want to compute the posterior IRFs of all the observed variables. In this case Dynare won't warn you about the absence of declared variables after the estimation command.

Regards,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: DSGE VAR example bvar_forward.mod falls over at IRFs

Postby gin » Thu Mar 21, 2013 12:41 pm

How to set the option in the mod file to let Dynare choose all the observed variables (option 2), such that Dynare won't ask that question and ones does not have to write all the observed variables after the estimation command?
-------------------------
gin
http://gin.mozello.com
gin
 
Posts: 47
Joined: Wed Feb 27, 2013 3:10 pm
Location: Riga, Latvia

Re: DSGE VAR example bvar_forward.mod falls over at IRFs

Postby jpfeifer » Thu Mar 21, 2013 9:04 pm

Currently, I think the only way is to copy manually everything you wrote behind the var_obs-command. Sorry.
------------
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 contributions and examples

Who is online

Users browsing this forum: No registered users and 2 guests