# Covariance of exogenous shocks

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

Can you please provide me with the files? Which Dynare version are you using?

I’m using the version 4.4.3.

this is the code I write in dynare.

[code]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;

check; // CHECKING OF BLANCHARD-KAHN CONDITION

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

end;

stoch_simul(dr_algo=0, order=1, periods=1000, irf=30, nograph);
[/code]

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

Thank you very much for your help

1. What do you mean with

[quote]compute the policy funcion by hand?
[/quote]

1. The displayed correlations are for the exogenous variables, i.e.

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

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 github.com/JohannesPfeifer/DSGE_mod/blob/master/Caldara_et_al_2012/Caldara_et_al_2012.mod for an example.

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:

``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.
Schermata 2016-12-09 alle 14.56.15.pdf (14.9 KB)

1.) I still don’t get why you think it’s strange. You specified the covariance matrix to be

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