Page 1 of 1

DSGE based-on IRF from VAR's

PostPosted: Thu Feb 24, 2011 6:39 pm
by Nrodriguez
Hi, Is possible to estimate a model that mimic or replicate the IRF from a VAR? If that is correct, could you give me some ideas of how could I do that?
Thanks,

Re: DSGE based-on IRF from VAR's

PostPosted: Thu Feb 24, 2011 8:45 pm
by jpfeifer
Sounds like you want to perform impulse response function matching. See e.g. http://ideas.repec.org/p/duk/dukeec/07-04.html

Re: DSGE based-on IRF from VAR's

PostPosted: Thu Feb 24, 2011 9:37 pm
by Nrodriguez
Thanks, the article is very interesting. Could this be implemented in Dynare? How?

Re: DSGE based-on IRF from VAR's

PostPosted: Fri Feb 25, 2011 12:03 pm
by Nrodriguez
My questions are about implementing limited information models in Dynare based-on IRF or VDec from a VAR.
Thanks for your attention

Re: DSGE based-on IRF from VAR's

PostPosted: Fri Feb 25, 2011 5:12 pm
by jpfeifer
I am not sure that you cannot directly implement it in Dynare. I guess the way to proceed is the following:

First, design a model you want to fit in Dynare. Just calibrate it to some values and see if it is in principle able to generate the kind of dynamics you are looking for. If it is not able to do so, there is no use to fitting a model to IRFs that it will never be able to generate.

Second, run Dynare with your model file once to generate the IRFs you want to match. Make sure that the IRFs are correctly displayed, and that only the time horizon you want to match is computed. Also, shut off everything in the stoch_simul command, e.g. nofunctions (see manual).

Third, rerun Dynare, but place the line
Code: Select all
evalin('base','save level0workspace oo_ M_ options_')
before the stoch_simul-command. This will save the workspace immediately before stoch_simul is called.

Now, write a set of functions that performs the IRF-matching.

Fourth, program an objective function that takes as inputs the parameters you want to estimate and as output the criterion function that gives the weighted distance between the model and the empirical IRFs. In the objective function, use
Code: Select all
global oo_ M_ options_
load level0workspace oo_
to have available the workspace you saved and reset the results-structure in each iteration step. Then use the Dynare function set_param_value() to set the parameters given to the function into Dynare before computing IRFs. Then extract the program code lines after the evalin command up to and including the stoch_simul command from the m-file created by Dynare in the third step.
By doing this, your program runs the Dynare solver and generates IRFs which are stored in oo_. (It might be necessary to change the Dynare file stoch_simul in order to prevent each run from displaying the IRFs in a plot). Finally in this file, compare the IRFs generated by Dynare with the set of parameters set through set_param_value with the empirical ones and give as output the value of the criterion function.

Also program an outer file that loads level0workspace saved in step three and then uses a miminizer like fsolve or csminwel to minimize the objective function defined in step four over the parameters you want to estimate.

You may also want to define the empirical IRFs as global variables so they can be accessed in the objective function.

Re: DSGE based-on IRF from VAR's

PostPosted: Sat Feb 26, 2011 6:51 pm
by Nrodriguez
Thank you!!! This is very helpful