Page 1 of 1

Covariance of exogenous shocks

PostPosted: Thu Dec 08, 2016 12:15 pm
by marlenemaya
Hi,
we are simulating the asset market model by Bansal and Yaron. Results seems to be correct, but in the output the covariance matrix of shocks shows values equal to 0 for the covariance between each shock and itself. How can it be possible?
Thank you

Re: Covariance of exogenous shocks

PostPosted: Thu Dec 08, 2016 12:40 pm
by jpfeifer
Can you please provide me with the files? Which Dynare version are you using?

Re: Covariance of exogenous shocks

PostPosted: Thu Dec 08, 2016 1:16 pm
by marlenemaya
I'm using the version 4.4.3.

this is the code I write in dynare.
Code: Select all
var x,c,d,v,w;
varexo epsc, epsd, epsx;
parameters mic, mid, lambda, rho, delta, theta, psi;

mic=0.0015;
mid=0.0015;
lambda=3;
rho=0.979;
delta=0.99;
theta=1;
psi=0.133;

phi= 0.1;

model;
v=(delta^theta)* exp(-(theta/psi)*(c(+1))+(theta-1))*log(((1+(v(+1)))*exp(c(+1))/v(+1)))*(1+v(+1))*exp(c(+1)) ;
w=(delta^theta)*exp(-(theta/psi)*(c(+1))+(theta-1))*log(((1+(v(+1)))*exp(c(+1))/v(+1)))*(1+w(+1))*exp(d(+1)) ;
c=mic+x(-1)+epsc;
d=mid+lambda*x(-1)+epsd;
x=rho*x(-1)+epsx;


end;


initval;
c= 0.0015;
d= 0.0015;
x=0;
v= 15 ; 
w= 15;
epsc=0;
epsx=0;
epsd=0;
end;

steady;
check; // CHECKING OF BLANCHARD-KAHN CONDITION

shocks;
var epsc; stderr 0.0078;
var epsx; stderr 0.0351;
var epsd; stderr 0.0003432;

end;


steady(solve_algo=0);
stoch_simul(dr_algo=0, order=1, periods=1000, irf=30, nograph);




Also, how can I compute the policy funcion by hand?

Thank you very much for your help

Re: Covariance of exogenous shocks

PostPosted: Fri Dec 09, 2016 9:50 am
by jpfeifer
1. What do you mean with
compute the policy funcion by hand?

2. The displayed correlations are for the exogenous variables, i.e.
Code: Select all
varexo

But you introduced the correlation manually via a VAR structure for your shocks. That correlation therefore affects endogenous variables, i.e.
Code: Select all
var

That's why the display is correct.
3. I can't help but notice that you are using Epstein-Zin preferences. That will not work at first order and their implementation in Dynare is not correct. See https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Caldara_et_al_2012/Caldara_et_al_2012.mod for an example.

Re: Covariance of exogenous shocks

PostPosted: Fri Dec 09, 2016 2:07 pm
by marlenemaya
Thank you for your help :)
1. our preferences are crra.
the covariance matrix of the shocks that we get is shown in the pdf file attached below.
we think is just a strange result.

2. for the policy function: we have an assigment that ask us: "compute policy and transition functions on your own and check that they are the same as what dynare produces".
we used the code:
Code: Select all
PPSI = [(oo_.dr.ys)';(oo_.dr.ghx)';(oo_.dr.ghu)'];

and we got a matrix of coefficients identical to the policy function output produce by dynare but we cannot provide an explanation.

Re: Covariance of exogenous shocks

PostPosted: Sat Dec 10, 2016 8:15 am
by jpfeifer
1.) I still don't get why you think it's strange. You specified the covariance matrix to be
Code: Select all
shocks;
var epsc; stderr 0.0078;
var epsx; stderr 0.0351;
var epsd; stderr 0.0003432;
end;

These are all diagonal entries, which is exactly what you get. You did not specify any off-diagonal entries.
2.) I don't think the assignment asks you to read out the decision rules from Dynare, but rather wants you to compute them yourself, e.g. using the method of undetermined coefficients. And of course your code gives results identical to the one Dynare displays, because you are accessing the decision rule coefficients that Dynare computed and then displays. This is described in more detail in the manual