Larry's shock decomposition

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.

Larry's shock decomposition

Postby pburriel » Thu Dec 13, 2007 1:28 pm

Dear all,

Has anyone tried successfully to apply larry Christiano's code to calculate the shock decomposition posted on this forum?

His post was:
viewtopic.php?f=1&t=1381&p=2192#p2192 *

I have tried to apply what he suggests, but I do not get the right result.

It works fine for all the shocks together.

But when I do one shock at a time it does not work since the sum of all the contributions do not add up to the observed data (or to the result with all the shocks together).

My problem is that his code seems incomplete, since some of the variables used are defined elsewhere, and it is not completely clear to me what they refer to. Therefore, I am not sure if it is that I am filling the gaps wrongly or that there is something else wrong with my code.

Thanks,

Pablo

NB: * new url
pburriel
 
Posts: 23
Joined: Wed Jun 29, 2005 4:42 am

Larry's shock decomposition

Postby mkulish » Mon May 26, 2008 8:32 pm

Hi Pablo,

I tried Larry's shock decomposition and came across the same issue that the sum of the individual responses to shocks does not add up to the data.

This is what's happening, I guess. When you are doing that you are actually double counting the initial condition (or triple counting or more). In fact, you are adding the initial condition as many times as the number of shocks there are in your model.

For example, say you have Y(t) = A Y(t-1) + B e(t), where Y(t) is 2x1, and e(t) is also 2x1. Let e1(t) be the 2x1 vector that keeps the first shock and sets the other one to zero. e2(t) keeps the second shocks and sets the first to zero. Now, if you start from the initial condition Y(0), then in one case you would get for period one:
Y1(1) = A Y(0) + B e1(1), where Y1(t) is the vector that captures the simulated response to the first shock; and for the other shock you would get: Y2(1) = A Y(0) + B e2(t). Notice that if you just add the two simulated responses you would get
Y1(1) + Y2(2) = 2 A Y(0) + B e(1) and not Y(1) = A Y(0) + B e(1).

Best,
Last edited by mkulish on Wed Sep 23, 2009 11:25 am, edited 1 time in total.
Mariano
mkulish
 
Posts: 10
Joined: Sat Aug 11, 2007 7:23 am

Postby bigbigben » Thu Jul 24, 2008 5:51 pm

I haven't finished my exercise yet, but do you guys notice line 53. Larry actually took the inverse order not the actual order to stack the variables. I don't know what the purpose is, but it may cause some trouble.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Historical and Finite Horizon Forecast Error Decompostion

Postby bigbigben » Mon Aug 18, 2008 10:47 pm

I always ask questions on this forum. Here is some tiny contributions from me. I wrote a code to do the historical decomposition introduced by Larry, the main body of the code is composed by him, but I make some modification to add flexibilities. Another is from myself to do the finite horizon forecast error decompostion.

Please see the attachment and let me know if you find errors in them.
Attachments
swsp_util_habit5_vardecomp_forecast.m
(1.27 KiB) Downloaded 522 times
swsp_util_habit5_vardecomp.m
(3.07 KiB) Downloaded 509 times
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Postby bigbigben » Tue Aug 19, 2008 12:37 pm

[quote]My problem is that his code seems incomplete, since some of the variables used are defined elsewhere, and it is not completely clear to me what they refer to. Therefore, I am not sure if it is that I am filling the gaps wrongly or that there is something else wrong with my code.

Although his code is not a standalone executable file. The core is how to extract shock series and impute them to simulate data. For the underlying model, I guess it is the model used in his co-authored paper with Motto, Illut and Rastagno. The one with financial frictions.

I ran into the same issue with estimated model is because my "estimated" shock series are correlated, so the sum is not one. The sum of variances of data simulated by individual shocks always exceeds the variance of the true data or the data simulated by all shocks together.


[/quote]
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Postby Aqua » Wed Sep 17, 2008 9:10 am

Dear bigbigben,

thanks for writing and posting your code. However, it's clear it is "incomplete". You seem to show how to implement historical and variance decomposition given an estimated model, but the code depends on your model. To appreciate completely your contribution, could you post as well the .mod file and the data? Otherwise, I have to run another mod file, adapt your code and check if everything works fine. That 's a lot of work.

Thank you for posting the suitable .mod file and the data.

Best,

Aqua.
Aqua
 
Posts: 7
Joined: Sun Sep 23, 2007 8:50 am

Re: Larry's shock decomposition

Postby musmic » Sun Apr 19, 2009 10:03 am

Hi all,

Following Muklish's helpful explanation, is there any good or conventional way of handling the initial condition problem?
Is it desirable to divide the initial condition according to the number of shocks such that the sum of solution paths due to all shocks could add up to the actual data?

Many thanks!

Musmic
musmic
 
Posts: 6
Joined: Thu Mar 05, 2009 9:02 am

Re: Larry's shock decomposition

Postby almira » Wed May 20, 2009 10:34 am

Hello everyone!
I have a question to the Christiano's code for a finite-horizon variance decomposition.
One of you said that this code is available under:
http://www.cepremap.cnrs.fr/juillard/ma ... highlight=
But this link does not work, unfortunately.
Does anybody know where I can get this code? Or does Dynare provide finite-horizon variance decomposition in the meantime?
Thank you very much in advance!
Best,
Almira
almira
 
Posts: 2
Joined: Mon Feb 11, 2008 1:43 pm
Location: University of Bonn

Re: Larry's shock decomposition

Postby bigbigben » Wed May 20, 2009 1:33 pm

[quote="almira"]Hello everyone!
I have a question to the Christiano's code for a finite-horizon variance decomposition.
One of you said that this code is available under:
http://www.cepremap.cnrs.fr/juillard/ma ... highlight=
But this link does not work, unfortunately.
Does anybody know where I can get this code? Or does Dynare provide finite-horizon variance decomposition in the meantime?
Thank you very much in advance!
Best,[/quote]


Hey, here is the link to Larry's post.
viewtopic.php?f=1&t=1381&p=2192#p2192
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Larry's shock decomposition

Postby Pert » Fri Sep 10, 2010 11:26 am

How does one actually implement counterfactuals a la Christiano, Motto, Rostagno (Europe counterfactuals on growth, inflation, etc., if replaced by U.S, monetary policy, persistence, shocks, structure)?

Would simply changing the parameters in the mode file produce the correct results, or would that be wrong?
Pert
 
Posts: 14
Joined: Thu Dec 03, 2009 8:54 am


Return to Dynare help

Who is online

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