Page 1 of 1

how to estimate the correlation between two shocks?

PostPosted: Fri Apr 14, 2017 2:09 pm
by fuyangzhao
Hi Professor,
I want to estimate the standard deviations of two shock and also the correlation between them. Suppose I have two exogenous process:
a_t = rho_a*a_{t-1}+e_a,
b_t = rho_b*b_{t-1}+e_b.
And the variance-covariance matrix of e_a and e_b is:

[ sigma_a^2, phi*sigma_a*sigmab;
phi*sigma_a*sigmab, sigma_b^2 ].

How should I estimate phi, sigma_a, and sigma_b simutanously? Is the following lines right?

Code: Select all
var a b;
varexo sigma_a sigma_b;
parameters phi rho_a rho_b;
rho_a=0.9;rho_b=0.9;phi=0.5;

model;
a = rho_a*a(-1)+e_a;
b = rho_b*b(-1)+e_b;
end;

shocks;
var sigma_a; stderr 0.1;
var sigma_b; stderr 0.1;
var sigma_a, sigmab=phi*sigma_a*sigma_b;
end;

estimated_params;
stderr sigma_a, , 0.000000000001,100,INV_GAMMA2_PDF,0.1,2;
stderr sigma_b, , 0.000000000001,100,INV_GAMMA2_PDF,0.1,2;
phi, ,.00000001,.99999999999,BETA_PDF,0.33,0.23;
end;

estimated_params_init;
stderr sigma_a, 0.1;
stderr sigma_b, 0.1;
phi, 0.5;
end;

estimation(...);


Dynare can run the above code. But it seems that the value of phi doesn't effect the result.
Can you help me? Thanks!

Re: how to estimate the correlation between two shocks?

PostPosted: Fri Apr 14, 2017 2:39 pm
by jpfeifer
No, that won't work, because the shocks-block set a numerical value, not a relationship. You need to use
Code: Select all
estimated_params;
stderr sigma_a, , 0.000000000001,100,INV_GAMMA2_PDF,0.1,2;
stderr sigma_b, , 0.000000000001,100,INV_GAMMA2_PDF,0.1,2;
corr sigma_a, sigma_b, ,.00000001,.99999999999,BETA_PDF,0.33,0.23;
end;

See e.g. https://github.com/DynareTeam/dynare/blob/master/tests/TeX/fs2000_corr_ME.mod