Jorda(2005)—Local Projection Impulse Responses
Jorda(2005)—Local Projection Impulse Responses
https://estima.com/procedures/jordaaer2005.zip computes the impulse responses by local projections from Jorda(2005), "Estimation and Inference of Impulse Responses by Local Projections", American Economic Review, 95(1), pp 161-182. This does the New Keynesian model example (3 variable VAR using Cholesky factor shocks).
Detailed Description
Detailed Description
Re: Jorda(2005)—Local Projection Impulse Responses
Dear Tom,
Thanks so much for the sample code! I have the following 2 questions:
1. It seems that the number of observations used to get the local projection IR changes (decreases) as h increases. Am I right? Some of the sample codes posted on Oscar Jorda's website uses the same number of observations for all horizons, h=0, 1,....,hmax.
2. I think there is local projection IR for h=0 (which is just the Cholesky matrix times shock), and h=2, 3,... but I am wondering is there is no IR for h=1. I am sorry if I am wrong.
Thanks for your time,
Tatsuma
Thanks so much for the sample code! I have the following 2 questions:
1. It seems that the number of observations used to get the local projection IR changes (decreases) as h increases. Am I right? Some of the sample codes posted on Oscar Jorda's website uses the same number of observations for all horizons, h=0, 1,....,hmax.
2. I think there is local projection IR for h=0 (which is just the Cholesky matrix times shock), and h=2, 3,... but I am wondering is there is no IR for h=1. I am sorry if I am wrong.
Thanks for your time,
Tatsuma
Re: Jorda(2005)—Local Projection Impulse Responses
I don't think there's a strong reason to prefer one vs the other.twada wrote:Dear Tom,
Thanks so much for the sample code! I have the following 2 questions:
1. It seems that the number of observations used to get the local projection IR changes (decreases) as h increases. Am I right? Some of the sample codes posted on Oscar Jorda's website uses the same number of observations for all horizons, h=0, 1,....,hmax.
You're correct. I've fixed the program. Note that the labeling of the responses in the paper is wrong---the h=1 really are the impact shocks.twada wrote: 2. I think there is local projection IR for h=0 (which is just the Cholesky matrix times shock), and h=2, 3,... but I am wondering is there is no IR for h=1. I am sorry if I am wrong.
Re: Jorda(2005)—Local Projection Impulse Responses
Thanks, Tom. I checked the code and confirmed that my results are the same as yours.
Thanks also for pointing out the difference between the figures in the paper and those by Rats's.
Tatsuma
Thanks also for pointing out the difference between the figures in the paper and those by Rats's.
Tatsuma
Re: Jorda(2005)—Local Projection Impulse Responses
Dear Tom, how to obtain the local projection impulse response along with corresponding standard errors in table format??
Re: Jorda(2005)—Local Projection Impulse Responses
The linear projection IRF's are in LINPRJIRF(i,j) and the corresponding standard errors are in LINPRJSTDERR(i,j) where i is the target variable and j is the shock. I'm not sure how you want to organize a table of those, but you can use PRINT or COPY to get the values.
Re: Jorda(2005)—Local Projection Impulse Responses
I am trying to modify the code so that the graphs are generated individually rather than in the 3 by 3 format as it is now; Any help please? Thanks.TomDoan wrote:This computes the impulse responses by local projections from Jorda(2005), "Estimation and Inference of Impulse Responses by Local Projections", American Economic Review, 95(1), pp 161-182. This does the New Keynesian model example (3 variable VAR using Cholesky factor shocks).
The calculations for this are actually quite simple. The h step responses are computed by regressing Y(t) on Y(t-h), Y(t-(h+1)), ... and extracting the coefficient vector on the leading lag (that is, the Y(t-h)) in that. That n x n matrix gives the local projection responses of the n variables (rows) to unit shocks in the n variables (columns). Different shock patterns can be obtained by post-multiplying that matrix by a set of weights on the unit shocks (in this case, by the Cholesky factor of the residuals from a standard VAR). (Standard IRF's effectively do the same thing for multi-step responses except the multi-step projection is a known function of the standard VAR coefficients rather than being estimated directly).
The regression with skipped lags will have serially correlated errors. The standard errors of the IRF's are computed using some form of HAC covariance estimates for that lead coefficient matrix. Because there are different ways of computing those, the standard errors will differ as well.
A few things to note.
- The graphs in the RATS program label the impact shock as 0 (as is more typical) while Jorda uses 1.
- The RATS graphs are organized in the more typical way with variables across and shocks down. They also use a common scale going across for all responses of a given variable.
- This does not do the cubic projections. That's not dramatically more complicated, but it's not clear that there's a great advantage to it, and the cubic responses have to be linearized about some value for the lagged y's anyway (which the linear projection responses are independent of those).
Re: Jorda(2005)—Local Projection Impulse Responses
You have to comment out the SPGRAPH instructions (two lines at the top, one at the bottom):
*spgraph(hfields=nshock,vfields=%nvar,xlabels=varlabels,ylabels=shocklabels,$ * footer="Figure 5. Impulse Responses for the New Keynesian Model based on a VAR and Linear Projections") do i=1,%nvar * * Compute the upper and lower bounds for each of the responses * for variable i, then find the max and min across all the shocks * do j=1,nshock set lower(j) 1 nstep+1 = linprjirf(i,j)-2.0*linprjstderr(i,j) set upper(j) 1 nstep+1 = linprjirf(i,j)+2.0*linprjstderr(i,j) end do j table(noprint) 1 nstep+1 lower upper do j=1,nshock graph(row=i,col=j,number=0,min=%minimum,max=%maximum) 4 # baseirf(i,j) # linprjirf(i,j) # lower(j) / 3 # upper(j) / 3 end do j end do i *spgraph(done)That also eliminates the labeling, so you would have to add a header or footer option to the GRAPH instruction.
Re: Jorda(2005)—Local Projection Impulse Responses
Thanks Tom, working perfectly now.TomDoan wrote:You have to comment out the SPGRAPH instructions (two lines at the top, one at the bottom):
*spgraph(hfields=nshock,vfields=%nvar,xlabels=varlabels,ylabels=shocklabels,$ * footer="Figure 5. Impulse Responses for the New Keynesian Model based on a VAR and Linear Projections") do i=1,%nvar * * Compute the upper and lower bounds for each of the responses * for variable i, then find the max and min across all the shocks * do j=1,nshock set lower(j) 1 nstep+1 = linprjirf(i,j)-2.0*linprjstderr(i,j) set upper(j) 1 nstep+1 = linprjirf(i,j)+2.0*linprjstderr(i,j) end do j table(noprint) 1 nstep+1 lower upper do j=1,nshock graph(row=i,col=j,number=0,min=%minimum,max=%maximum) 4 # baseirf(i,j) # linprjirf(i,j) # lower(j) / 3 # upper(j) / 3 end do j end do i *spgraph(done)That also eliminates the labeling, so you would have to add a header or footer option to the GRAPH instruction.
However, VAR and LLP response are plotted in the same graph (please see example 1 attached). I am only interested in the LLP plots. Please how doI get rid off of the VAR response?
Thanks.
- Attachments
-
- Example1.RGF
- (668 Bytes) Downloaded 1358 times
Re: Jorda(2005)—Local Projection Impulse Responses
Change this to graph 3 rather than 4, and delete the # baseirf(i,j) line
graph(row=i,col=j,number=0,min=%minimum,max=%maximum) 4
# baseirf(i,j)
# linprjirf(i,j)
# lower(j) / 3
# upper(j) / 3
graph(row=i,col=j,number=0,min=%minimum,max=%maximum) 4
# baseirf(i,j)
# linprjirf(i,j)
# lower(j) / 3
# upper(j) / 3
Re: Jorda(2005)—Local Projection Impulse Responses
TomDoan wrote:Change this to graph 3 rather than 4, and delete the # baseirf(i,j) line
graph(row=i,col=j,number=0,min=%minimum,max=%maximum) 4
# baseirf(i,j)
# linprjirf(i,j)
# lower(j) / 3
# upper(j) / 3
Thanks Tom. All working fine now. Much appreciated.
Oz
Re: Jorda(2005)—Local Projection Impulse Responses
Hello Toam,
dou you also have code for lag augmented Local projection impulse responses or any suggestion.
thanks
dou you also have code for lag augmented Local projection impulse responses or any suggestion.
thanks
Re: Jorda(2005)—Local Projection Impulse Responses
There is nothing particularly difficult about that, but I am skeptical about any paper that cites Toda-Yamamoto as authority.