Page 1 of 1

Historical Decomposition

PostPosted: Tue Oct 07, 2014 1:01 am
by costa
Hi all,

I have estimated a large model, with 70 endogenous variables and 12 shocks. Everything ran ok. What I want to do is to produce a table with the contribution of each shock for some selected endogenous variables (output, inflation, exchange rate) for each year in the sample (58 at all), or for some periods. For this goal, I was trying to work with the data stored in the oo.shock_decomposition. According to this explanation, http://www.dynare.org/dynare-matlab-m2h ... ition.html, as an outcome of the estimation I get 58 matrices, each one a 70x 14 matrix, where the 13th column is the role of the initial conditions, while the 14th column is the smooth variable. If my understanding is correct, each row in the matrix corresponds to one endogenous variable. My question (and problem) is : I was comparing the smoothed variables, which are stored in the oo. area, but I couldnĀ“t find the values displayed in the last column of the matrix. So, the last column really correspond to the smoothed variables ? How can I know for sure to which endogenous variable it is linked ? As far is I know my main problem is to map the values in the matrix to the endogenous variable it refers to.

Thanks in advance.

Re: Historical Decomposition

PostPosted: Tue Oct 07, 2014 8:44 am
by jpfeifer
All you need to know is here:
Code: Select all
for i=1:endo_nbr
 z(i,end,:) = eval(['oo.SmoothedVariables.' M_.endo_names(i,:)]);
end

squeeze(z(:,end,:)) is an M_.endo_nbr by nperiods matrix containing the SmoothedVariables. The rows correspond to the endogenous variables in the order stored in M_.endo_names.

Re: Historical Decomposition

PostPosted: Sun Oct 12, 2014 12:25 pm
by costa
Thanks. Is it correct to assume that the order of the endogenous variables is the same as on the declaration ?

Re: Historical Decomposition

PostPosted: Mon Oct 13, 2014 5:01 am
by jpfeifer
Yes, except for the declaration not storing the auxiliary variables at the end of M_.endo_names.