Variance decomposition for correlated 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.

Variance decomposition for correlated shocks

Postby JX2016 » Fri Aug 12, 2016 3:31 am

Hi, Dr. Pfeifer

I wonder how I can compute the variance decomposition of two correlated shocks?



Say, we have 3 such AR(1) shock processes Y = Y(-1) +eA and X = X(-1) +eB and Z = Z(-1) +eC. eA and eB are correlated innovations. eC is independent.

That is:

eA = u +u1 and eB = gam*u +u2 as in this thread I found: viewtopic.php?f=1&t=2574&p=16229&hilit=correlated+shocks#p16229


If eA and eB are correlated but eC is independent from eA and eB , I wonder how I can compute the variance decomposition of eA eB and eC in this case ?
JX2016
 
Posts: 14
Joined: Fri Jun 24, 2016 2:10 pm

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Fri Aug 12, 2016 6:45 am

Because the covariance matrix is not diagonal, the shocks are not orthogonal. Therefore you must use an orthogonalization scheme. This will provide you with a range of possible values by using the upper and lower Cholesky decomposition. Dynare by default uses the upper Cholesky decomposition in case of correlated shocks.
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Tue Nov 08, 2016 5:14 am

jpfeifer wrote:Because the covariance matrix is not diagonal, the shocks are not orthogonal. Therefore you must use an orthogonalization scheme. This will provide you with a range of possible values by using the upper and lower Cholesky decomposition. Dynare by default uses the upper Cholesky decomposition in case of correlated shocks.


Dear Johannes,

Could I ask further on this topic?

If u and e are 2 correlated shocks, then the unconditional variance decomposition results (after stoch_simul option) report that shock u accounts for 60% of fluctuation of output. Could I ask how I should explain this number?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Tue Nov 08, 2016 9:03 am

In that case, you assume that all comovement of the two shocks is caused by the shock ordered first, i.e. you say that the first declared shock is partially transmitted via the last shock.
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Wed Nov 09, 2016 4:33 am

jpfeifer wrote:In that case, you assume that all comovement of the two shocks is caused by the shock ordered first, i.e. you say that the first declared shock is partially transmitted via the last shock.


Many thanks.
Could I ask one more question on this?

If A and B are correlated two shocks, all comovement caused by first ordered shock A and I would like to do counterfactual exercise------see what will happen when only one shock (e.g ,shock B) hits the model. So I take all estimated shock B series into the model and shut down shock A. I am wondering if this is right since in the counterfactual exercise I do not consider the truth that estimated shock B series is partially affected by shock A.

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Wed Nov 09, 2016 7:24 pm

If you want to only consider the effect of the shock B ordered last, you need to purge the residual of that equation from the effect of shock A that affects both equations.
Say the observed residuals are given by
[res_1; res_2]=[A;B]*R
where R is the upper Cholesky matrix. Then you can back out the shocks A and B by postmultiplying the left hand side by R^{-1}.
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Thu Nov 10, 2016 12:25 am

jpfeifer wrote:If you want to only consider the effect of the shock B ordered last, you need to purge the residual of that equation from the effect of shock A that affects both equations.
Say the observed residuals are given by
[res_1; res_2]=R*[A;B]
where R is the upper Cholesky matrix. Then you can back out the shocks A and B by premultiplying the left hand side by R^{-1}.


Many thanks. Could I ask further?

1. R is the upper Cholesky matrix from the diagonal and upper triangle of variance covariance matrix. Could I ask if the variance covariance matrix is NOT be positive definite, how should I do?

2. As for shock (historical) decomposition , dynare will do cholesky decomposition to variance covariance matrix in default so I can directly use shock decomposition results generated by dynare . To see which shock is more important,I can report shock decomposition OR counterfactual exercise, but generally which one is better/preferred?

3.Since changing the order of correlated shocks in varexo block, then the theoretical unconditional variance decomposition (after stoch simul) changes much... I am wondering which result should be reported. Is that depending on assumption like which shock actually causing comovement?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Thu Nov 10, 2016 9:28 am

First, please note that I adjusted the previous posts to reflect the Dynare ordering that the first declared shock accounts for the covariance, not the last one.
1. What Dynare does is
Code: Select all
    i_exo_var = setdiff([1:M_.exo_nbr],find(diag(M_.Sigma_e) == 0 ));
    nxs = length(i_exo_var);
    chol_S = chol(M_.Sigma_e(i_exo_var,i_exo_var));

i.e. only the non-zero diagonal entries are decomposed.
2. That depends on your preferences. In principle, those two things are the same.
3. Yes, exactly. With correlated shocks the ordering matters. If you don't have a strong prior what the correct ordering is, the usual way is to invert the ordering and report the resulting range.
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Thu Nov 10, 2016 9:59 am

jpfeifer wrote:If you want to only consider the effect of the shock B ordered last, you need to purge the residual of that equation from the effect of shock A that affects both equations.
Say the observed residuals are given by
[res_1; res_2]=[A;B]*R
where R is the upper Cholesky matrix. Then you can back out the shocks A and B by postmultiplying the left hand side by R^{-1}.


Many thank, Johannes.

Could I ask 2 more ?

1. if I want to only consider the effect of the shock A ordered first, should I do
[res_1; res_2]=[A;B]*R
where R is now the lower Cholesky matrix?

2. In shock(historical ) decomposition figure, (first ordered )shock A 's area is just caused by shock A ,while (last ordered) shock B's area is not only caused by B but also caused by A( comovement with A)? right?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Thu Nov 10, 2016 10:52 am

Sorry, I had to do another correction above.
1. No, if you were doing this, you would get a wrong covariance matrix and would be trying to invert the ordering.
2. No, for the first shock, you get the full effect of this shock, even the part that is mediated by the other shocks (due to the causal assumption behind the ordering). For B, the second shock, it would be the effect of B after purging the effect A has on B.
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Fri Nov 11, 2016 2:31 am

jpfeifer wrote:If you want to only consider the effect of the shock B ordered last, you need to purge the residual of that equation from the effect of shock A that affects both equations.
Say the observed residuals are given by
[res_1; res_2]=[A;B]*R
where R is the upper Cholesky matrix. Then you can back out the shocks A and B by postmultiplying the left hand side by R^{-1}.


Many thanks again.

1. If I want to only consider the effect of A ordered First in counterfactual exercise , I do not need do Cholesky decomposition since A is not affected by other shocks( even though A is correlated with other shocks), so I simply take smoothed A series into the model will be OK, right?
2.
Code: Select all
x = rho*x(-1) + u;

In counterfactual exercise,should people take smoothed innovation u or smoothed variable x into model to see what will happen when there is only one shock x hitting the economy?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Fri Nov 11, 2016 3:03 am

jpfeifer wrote:Sorry, I had to do another correction above.
1. No, if you were doing this, you would get a wrong covariance matrix and would be trying to invert the ordering.
2. No, for the first shock, you get the full effect of this shock, even the part that is mediated by the other shocks (due to the causal assumption behind the ordering). For B, the second shock, it would be the effect of B after purging the effect A has on B.



Many thanks. In addition to several questions in the last post, could I also ask:

I find that even I change the order of 2 correlated shocks, the shock_decompostion figures are NOT changed (of course shocks order in the figure changes, but each shock has exactly same length in same period no matter ordered first or last). Does that make sense?

As for unconditional variance decomposition after stoch_simul , for the first shock, I get the full effect of this shock; while for B, the second shock, it would be also the effect of B after purging the effect A has on B?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Re: Variance decomposition for correlated shocks

Postby DW916 » Sat Nov 12, 2016 12:53 pm

jpfeifer wrote:If you want to only consider the effect of the shock B ordered last, you need to purge the residual of that equation from the effect of shock A that affects both equations.
Say the observed residuals are given by
[res_1; res_2]=[A;B]*R
where R is the upper Cholesky matrix. Then you can back out the shocks A and B by postmultiplying the left hand side by R^{-1}.


Dear Johannes,

I am also interested in this topic. To back out A and B for counterfactual exercise using this method will result in A and B series MUCH MORE (unreasonably) Volatile than observed residuals...would that be a problem or is there any problem of scaling?

Thanks in advance.

Catherine
DW916
 
Posts: 31
Joined: Sat Feb 27, 2016 9:05 am

Re: Variance decomposition for correlated shocks

Postby jpfeifer » Sun Nov 13, 2016 3:14 pm

@ZBCPA:
1. The correct treatment depends on what your aim is. You seem to be worrying about a historical counterfactual. There, things are different. See my point 3.

2. If you consider a fixed parameter set, there is a one to one mapping between smoothed innovations and the smoothed x. If you start with the smoothed initial value for x and feed in the smoothed shocks for u, you will get the historical series for x. When feeding this into the model, you usually feed in the u, but if x is exogenous, you could also use x (although this might be complicated to do if your model is written with x(-1) and u in there)

3. Regarding shock_decomposition: I was too quick and therefore wrong. shock_decomposition displays the counterfactual time series based on the historically encountered shocks. For these, it makes no sense to orthogonalize them, because that is just the way the shocks happened. It is not a statement about deep causation between correlations, but about shocks that occurred. Even theoretically uncorrelated shocks can have correlation in short samples.
That is why shock_decomposition (which relies on in-sample shocks), is not affected by the variables ordering - in contrast to the variance_decomposition, which is a theoretical property relying on asymptotics.

4. for the variance decomposition: Yes, the shocks are orthogonalized. The value for the first shock will include its direct effect on variables plus any indirect effect it has via other shocks it is assumed to move. The second shock in turn will be orthogonalized with respect to the first one. Its effect will therefore only include its direct and indirect effects via other shocks after accounting for the portion that is transmitted via the first shocks's effect on the second one. This goes on until the last shock only has a direct effect via the part not already explained by the shocks ordered before it.


@ Catherine:
Without knowing what exactly you are doing, it is hard to tell what is going on. But there is always the issue of whether you decompose the correlation or covariance matrix. Doing a decomposition like this on historical data is also unusual in the context of DSGE models, because the shocks are already identified - in contrast to VARs. Thus, the only reason for orthogonalization is for ease of interpretation for some theoretical properties like a variance decomposition (and to generate correlated random numbers)
------------
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

Re: Variance decomposition for correlated shocks

Postby ZBCPA » Mon Nov 14, 2016 9:42 am

jpfeifer wrote:@ZBCPA:
1. The correct treatment depends on what your aim is. You seem to be worrying about a historical counterfactual. There, things are different. See my point 3.

2. If you consider a fixed parameter set, there is a one to one mapping between smoothed innovations and the smoothed x. If you start with the smoothed initial value for x and feed in the smoothed shocks for u, you will get the historical series for x. When feeding this into the model, you usually feed in the u, but if x is exogenous, you could also use x (although this might be complicated to do if your model is written with x(-1) and u in there)

3. Regarding shock_decomposition: I was too quick and therefore wrong. shock_decomposition displays the counterfactual time series based on the historically encountered shocks. For these, it makes no sense to orthogonalize them, because that is just the way the shocks happened. It is not a statement about deep causation between correlations, but about shocks that occurred. Even theoretically uncorrelated shocks can have correlation in short samples.
That is why shock_decomposition (which relies on in-sample shocks), is not affected by the variables ordering - in contrast to the variance_decomposition, which is a theoretical property relying on asymptotics.

4. for the variance decomposition: Yes, the shocks are orthogonalized. The value for the first shock will include its direct effect on variables plus any indirect effect it has via other shocks it is assumed to move. The second shock in turn will be orthogonalized with respect to the first one. Its effect will therefore only include its direct and indirect effects via other shocks after accounting for the portion that is transmitted via the first shocks's effect on the second one. This goes on until the last shock only has a direct effect via the part not already explained by the shocks ordered before it.


@ Catherine:
Without knowing what exactly you are doing, it is hard to tell what is going on. But there is always the issue of whether you decompose the correlation or covariance matrix. Doing a decomposition like this on historical data is also unusual in the context of DSGE models, because the shocks are already identified - in contrast to VARs. Thus, the only reason for orthogonalization is for ease of interpretation for some theoretical properties like a variance decomposition (and to generate correlated random numbers)





Thank you so much Johannes!

Since shock_decomposition does not orthogonalize shocks while variance decomposition does, then it is possible that shock A in shock_decomposition accounts for much of output fluctuations while in variance decomposition shock A only accounts for very little. Would there be any problem in this case since the two results are not consistent with each other?

Kind regards,
Huan
ZBCPA
 
Posts: 101
Joined: Sat May 16, 2015 4:15 am

Next

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 11 guests