mtp wrote:How do you decompose the correlation between two variable into the contributions of the structural shocks?
Decomposing the covariance is relatively straightforward. If FACTOR is a factor of the covariance matrix %SIGMA, then
%xrow(factor,1).*%xrow(factor,2)
will give an additive decomposition of %SIGMA(1,2), and similarly for other subscripts replacing 1 and 2.
An analogous calculation for the correlation would take the equation Fv=u and rescale both sides by the diagonal matrix which makes the variances of u equal to 1 (1/sqrt(diagonal elements of %sigma)).
dec rect rd(n,n)
ewise rd(i,j)=%if(i==j,1.0/sqrt(%sigma(i,j)),0.0)
disp %xrow(rd*factor,1).*%xrow(rd*factor,2)