Page 1 of 1

saving the estimated shocks

PostPosted: Wed Feb 01, 2006 6:54 pm
by iacoviel
Dear all,

let me say upfront that I am not a big estimation expert.

I am estimating a model using Bayesian methods and would like the do the following experiment: after estimating the model, I would like to feed the estimated shocks back into the estimated model to run counterfactuals and historical decompositions.

What I am currently doing to implement this is the following:

1) During the estimation, I save the estimated shocks (which are stored by Dynare in the "innov" matrix) adding a line saying "save innov" around line 800 in the file dynare_estimation.m

2) After estimation, I simulate the estimated model replacing the "ex_" matrix inside the simult.m file with the "innov" matrix itself.

My understanding is that the innov are the smoothed shocks and do not replicate the model exactly when I feed them back in the model. In fact, model and actual series do not line up exactly. I was wondering whether there is a way conceptually and practically to do the counterfactuals in the model better than the one I am currently using

Thanks

PostPosted: Wed Feb 08, 2006 2:50 pm
by MichelJuillard
You don't need to dig into dynare_estimation. After estimation, the smoothed shocks are available in dr_.posteriorSmoothedShocks

The simulation with the smoothed shocks should replicate exactly the observed variable. Be careful about ordering the variables. It isn't straightforward in simult_.m. Be careful about intercept, too.

You can send me your program or post it on the forum

Best

Michel

PostPosted: Thu Feb 09, 2006 5:45 am
by iacoviel
Hi Michel,

thanks for your tip. I will send you the file in the next days, once I have checked a few things. I just want to be sure about your point: should the smoothed shocks should replicate exactly the (1)actual variables or (2) the smoothed variables. It seems to me that (1) and (2) are not identical, and that the smoothed shocks replicate (2) not (1). But maybe I am missing something. I will keep you posted.

Matteo

PostPosted: Thu Feb 09, 2006 6:09 pm
by MichelJuillard
In my exprerience the smoothed values of the observed variables are identical to the observations. If you have an example where it isn't the case, please send it to me

Best

Michel

PostPosted: Sat Feb 11, 2006 3:35 pm
by jmaih
If I may add something... Smoothed variables should correspond to actual variables when there are no measurement errors.

Junior