how to estimate the correlation between two shocks?

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.

how to estimate the correlation between two shocks?

Postby fuyangzhao » Fri Apr 14, 2017 2:09 pm

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!
fuyangzhao
 
Posts: 48
Joined: Thu Dec 10, 2015 1:20 pm

Re: how to estimate the correlation between two shocks?

Postby jpfeifer » Fri Apr 14, 2017 2:39 pm

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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests