Historical Decomposition

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.

Historical Decomposition

Postby costa » Tue Oct 07, 2014 1:01 am

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.
costa
 
Posts: 47
Joined: Thu Nov 14, 2013 8:09 pm

Re: Historical Decomposition

Postby jpfeifer » Tue Oct 07, 2014 8:44 am

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.
------------
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

Re: Historical Decomposition

Postby costa » Sun Oct 12, 2014 12:25 pm

Thanks. Is it correct to assume that the order of the endogenous variables is the same as on the declaration ?
costa
 
Posts: 47
Joined: Thu Nov 14, 2013 8:09 pm

Re: Historical Decomposition

Postby jpfeifer » Mon Oct 13, 2014 5:01 am

Yes, except for the declaration not storing the auxiliary variables at the end of M_.endo_names.
------------
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 help

Who is online

Users browsing this forum: No registered users and 13 guests