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

Variance decomposition

Postby ambropo » Mon Jun 06, 2011 3:00 pm

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
ambropo
 
Posts: 9
Joined: Mon Jun 06, 2011 2:45 pm

Re: Variance decomposition

Postby jpfeifer » Tue Jun 07, 2011 5:30 pm

Hi, you explicitly need to invoke
Code: Select all
conditional_variance_decomposition

in stoch_simul (see the manual on page 34)
------------
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: Variance decomposition

Postby ambropo » Wed Jun 08, 2011 1:52 pm

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

Code: Select all
% 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);
ambropo
 
Posts: 9
Joined: Mon Jun 06, 2011 2:45 pm

Re: Variance decomposition

Postby jpfeifer » Wed Jun 08, 2011 2:30 pm

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.
------------
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: Variance decomposition

Postby ambropo » Wed Jun 08, 2011 2:39 pm

Thanks!!
ambropo
 
Posts: 9
Joined: Mon Jun 06, 2011 2:45 pm

Re: Variance decomposition

Postby SébastienVillemot » Tue Aug 23, 2011 3:55 pm

The description of this variable will appear in the next version of the reference manual. Thanks for the feedback.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests