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.

Shock decomposition..

Postby larry » Tue Jun 26, 2007 12:31 am

We guessed that unloading the shocks from oo_.SmoothedShocks and simulating the response of the system using Dynare's simult_.m would reproduce the time series observations used in the estimation (there are no measurement errors). Should it?

This is the first step in a particular shock-decomposition exercise. We want to simulate the response of the system to one estimated shock at a time, to see how history would have evolved with only that shock. Is there an easy way to get Dynare to do this exercise?
Larry Christiano
larry
 
Posts: 7
Joined: Sun Feb 11, 2007 8:31 pm
Location: northwestern university

Postby pycs » Tue Jun 26, 2007 11:22 pm

I would be interested in knowing how to do that as well.
pycs
 
Posts: 6
Joined: Mon Feb 13, 2006 5:47 am

Postby larry » Wed Jun 27, 2007 12:01 am

I figured it out!

Here is an example, which illustrates what's going on. Suppose you have a scalar ar: y(t) = rho*y(t-1) + eps(t), and observations on y(1), y(2). Dynare gives you the smoothed estimate of eps(1) and eps(2). The second one is obvious: epshat(2) = y(2) - rho*y(1). The first one is less obvious, but it's based on the fact that the smoothed estimate of y(0) is rho*y(1) (you can verify this by computing the coefficients in the linear projection of y(0) onto y(1) and y(2)). Thus, epshat(1)=y(1)-rho*y(0)=y(1)-rho^2*y(1)=(1-rho^2)*y(1). When you take the smoothed estimates, epshat(1) and epshat(2), and simulate them, it's a mistake to do this (this is what I was doing!):

yhat(1)=rho*(unconditional mean of y(0)) + epshat(1)
yhat(2)=rho*yhat(1) + epshat(2).

This will give the wrong answer, as simple substitution will verify. You get the right answer by replacing unconditional mean of y(0) with its smoothed estimate.

Another way to get the right answer is much simpler. Make the initial condition equal to the smoothed estimate of the initial condition and simulate forward using the smoothed shocks. In the example, you start with yhat(2) = rho*y(1) + epshat(2), which is obviously y(2).

In an practical model, y(t) is a vector with a subset of variables observed. But, the basic idea is the same. You find the smoothed shocks in oo_.SmoothedShocks. The smoothed y(t)'s are in oo_.SmoothedVariables (though they are re-ordered...use the indeces in dr_.inv_order_var to map to the alphabetically ordered representation of y(t)).

You can verify that by doing this simulation with all estimated shocks (use the Dynare .m file, simult_ for this simulation), you reproduce the actual data. Then, simply redo the simulation with only one shock at a time, and that's how you get the shock decomposition. I've included my code for doing this, as an example

Larry
Attachments
simtest.m
(3.24 KiB) Downloaded 995 times
Larry Christiano
larry
 
Posts: 7
Joined: Sun Feb 11, 2007 8:31 pm
Location: northwestern university

Postby MichelJuillard » Wed Jun 27, 2007 2:57 pm

Thanks Larry, much appreciated. I will try to adapt it for version 4 and include it in Dynare in a non too distant future.

Kind regards

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby larry » Thu Jun 28, 2007 1:56 am

It would be neat to have a confidence tunnel around each historical shock decomposition, arising from measurement error (if included) and parameter uncertainty. My guess is that parameter uncertainty will make the confidence tunnel on individual shocks quite large, however.
Larry Christiano
larry
 
Posts: 7
Joined: Sun Feb 11, 2007 8:31 pm
Location: northwestern university


Return to Dynare help

Who is online

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