Variance decomposition

Hi, I am new user of Dynare.

As far as I understood, when performing the stoch_simul command, the shock variance decomposition is computed and stored in oo_.gamma_y{7,1} (the first 6 elements being the autocovariances of order 0 to 6).

I made a trial with the example file rbc.mod (from Fernandez-Villaverde files). In the original file, the model is solved with stoch_simul(order = 1) and no variance decomposition is computed. Is this because of the first order approximation (i.e., certainty equivalence)?

I therefore modified the command to get a second order approximation, stoch_simul(order = 2). Nonetheless, I get an empty cell in oo_.gamma_y{7,1}. Why is that? Also, cell oo_.gamma_y{8,1} is not empty, but the numbers are different from one. Given that tehre is only one shock, I expected that it accounted for 100% of the variance of the endogenous variables. Am I wrong?

Thanks in advance,
Ambrogio

Hi, you explicitly need to invoke

in stoch_simul (see the manual on page 34)

Thanks for your answer, I still get weird results though: an ampty cell in oo_.gamma_y{7,1} and oo_.gamma_y{8,1} is not empty, but the numbers are different from one. Here is the code I am using

% Basic RBC Model 
%
% Jesus Fernandez-Villaverde
% Philadelphia, March 3, 2005

%----------------------------------------------------------------
% 0. Housekeeping (close all graphic windows)
%----------------------------------------------------------------

close all;

%----------------------------------------------------------------
% 1. Defining variables
%----------------------------------------------------------------

var y c k i l y_l z;
varexo e;

parameters beta psi delta alpha rho;

%----------------------------------------------------------------
% 2. Calibration
%----------------------------------------------------------------

alpha   = 0.33;
beta    = 0.99;
delta   = 0.023;
psi     = 1.75;
rho     = 0.95;  
sigma   = (0.007/(1-alpha));

%----------------------------------------------------------------
% 3. Model
%----------------------------------------------------------------

model; 
  (1/c) = beta*(1/c(+1))*(1+alpha*(k^(alpha-1))*(exp(z(+1))*l(+1))^(1-alpha)-delta);
  psi*c/(1-l) = (1-alpha)*(k(-1)^alpha)*(exp(z)^(1-alpha))*(l^(-alpha));
  c+i = y;
  y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
  i = k-(1-delta)*k(-1);
  y_l = y/l;
  z = rho*z(-1)+e;
end;

%----------------------------------------------------------------
% 4. Computation
%----------------------------------------------------------------

initval;
  k = 9;
  c = 0.76;
  l = 0.3;
  z = 0; 
  e = 0;
end;

shocks;
var e = sigma^2;
end;

steady;

% stoch_simul(hp_filter = 1600, order = 1);
stoch_simul(conditional_variance_decomposition = 1);

There has been a change in the structure of oo_, which is not documented in the manual yet. You are looking into the wrong field. The conditional variance decomposition is stored in oo_.conditional_variance_decomposition, with the rows being ordered according to M_.endo_names and the columns representing the specified horizons.

Thanks!!

The description of this variable will appear in the next version of the reference manual. Thanks for the feedback.