Creating negartive one unit shocks in impulse
Creating negartive one unit shocks in impulse
Hi, I am trying to estimate a sacrifice ratio like in Cechetti and Rich (2001): Structural Estimates of the US Sacrifice Ratio. I'am using a SVAR with two variables, inflation and output (both in first differences). The VAR is estimated using the SYSTEM instruction and the errors are decomposed in the Blanchard-Quah fashion. I'am interested in analysing the effect of a negative unit shock on inflation (interpreted as a demand shock) on output so I would appreciate if someone can tell me how to program this on RATS. Below you will find the program I'am using. The montevar.src has been modified to use the "g" matrix computed earlier and to print the confidence intervals and the responses as well. I suppose this program will have to be modified also if I want to get the confidence intervals for the one unit negative shock on inflation. Thanks in advance.
cal 1991 01 04
all 0 2010:04
open data Y_INF.XLS
data(for=xls,org=obs) / DINF DY
TABLE
*****************FORMULACION DEL VAR******************
SYSTEM(MODEL= RS)
VARIABLES DY DINF
det constant
LAGS 1 TO 6
END(SYSTEM)
ESTIMATE(OUTSIGMA=V, RESIDUALS = RESIDS_RS, SIGMA,noprint)
***********Obtencion de las FIR usando la descomposicion de Blanchard-Quah (1989)****************
COM C = %VARLAGSUMS
COM S1=%MQFORM(%SIGMA,TR(INV(C)))
COM S2=%DECOMP(S1)
DIS S2
COM G= C*S2 ; DIS G
DECLARE RECTANGULAR[series] IMPULSES(2,2)
impulse(MODEL=RS,RESULTS= IMPULSES,DECOMP=G) * 20 * v
**************************Calculo de los intervalos de confianza********************************
@MonteVar(model=rs, step=20, draws=10000, header= 'Funciones de impulso respuesta',shocklabels=shocks,varlabels=variables)
cal 1991 01 04
all 0 2010:04
open data Y_INF.XLS
data(for=xls,org=obs) / DINF DY
TABLE
*****************FORMULACION DEL VAR******************
SYSTEM(MODEL= RS)
VARIABLES DY DINF
det constant
LAGS 1 TO 6
END(SYSTEM)
ESTIMATE(OUTSIGMA=V, RESIDUALS = RESIDS_RS, SIGMA,noprint)
***********Obtencion de las FIR usando la descomposicion de Blanchard-Quah (1989)****************
COM C = %VARLAGSUMS
COM S1=%MQFORM(%SIGMA,TR(INV(C)))
COM S2=%DECOMP(S1)
DIS S2
COM G= C*S2 ; DIS G
DECLARE RECTANGULAR[series] IMPULSES(2,2)
impulse(MODEL=RS,RESULTS= IMPULSES,DECOMP=G) * 20 * v
**************************Calculo de los intervalos de confianza********************************
@MonteVar(model=rs, step=20, draws=10000, header= 'Funciones de impulso respuesta',shocklabels=shocks,varlabels=variables)
Re: Creating negartive one unit shocks in impulse
Greene's textbook has an example of this calculation. This is grnp707.rpf in the Greene ed 6 examples.
Code: Select all
*
* Greene, Econometric Analysis, 6th Edition
* Example from 20.6.8 on pp 707-710
*
open data tablef5-1.txt
calendar(q) 1950
data(format=prn,org=columns) 1950:1 2000:4 year qtr realgdp realcons realinvs realgovt realdpi $
cpi_u m1 tbilrate unemp pop infl realint
*
* Because the data set doesn't have dates in a form that RATS
* recognizes, the data are read over the whole range. By restricting the
* range over which the transformed data are defined, we can force the
* subsequent analysis to be limited to the desired portion of the data.
*
set logc 1959:1 1997:4 = 100*log(realcons)
set logy 1959:1 1997:4 = 100*log(realgdp)
set delc = logc-logc{1}
set dely = logy-logy{1}
set delpi 1959:2 1997:4 = infl-infl{1}
*
graph(footer="Figure 19.5 Log GDP")
# logy
graph(footer="Figure 19.6 The Quarterly Rate of Inflation")
# infl 1959:1 1997:4
graph(footer="Figure 19.7 Rates of Change, log GDP and Rate of Inflation") 2
# dely
# delpi
*
* Unit root tests on log y and inflation
*
@dfunit(lags=4) logy
@dfunit(lags=4) infl
*
* Andrews-Ploberger/Quandt tests on the regressions on the differenced
* variables.
*
@apbreaktest dely
# constant dely{1 to 8} delpi{1 to 8}
@apbreaktest delpi
# constant dely{1 to 8} delpi{1 to 8}
*
* Set up and estimate the VAR
*
system(model=rcmodel)
variables dely delpi
lags 1 to 8
det constant
end(system)
*
estimate
*
* Compute the Blanchard-Quah factorization of the covariance matrix,
* with sign convention that both have positive impact for GDP.
*
compute bqfactor=%bqfactor(%sigma,%varlagsums)
compute bqfactor=%dmult(bqfactor,$
||%sign(bqfactor(1,1)),%sign(bqfactor(1,2))||)
*
* Do the impulse responses
*
impulse(model=rcmodel,factor=bqfactor,steps=80,$
results=responses,labels=||"Permanent","Transitory"||)
*
* The response of log GDP itself and of the inflation rate can be
* obtained by accumulating the responses of the differences (to the
* second shock, which is interpreted as the demand shock). For computing
* the sacrifice ratio, the GDP response needs to be accumulated twice.
*
* responses(1,2) is the response of del log GDP (variable 1) to shock 2
* and responses(2,2) is the response of del inflation (variable 2) to
* shock 2.
*
acc responses(1,2) / accoutput
acc accoutput / cumoutput
acc responses(2,2) / accinfl
*
* Compute sacrifice ratio
*
set sacratio = cumoutput/accinfl
*
graph(footer="Sacrifice Ratio",nodates)
# sacratioRe: Creating negartive one unit shocks in impulse
Hi Tom. Thank you very much for your reply. I run the program you posted but it seems to be an error when calculating the Blanchard-Quah decomposition. This the error I get:
compute bqfactor=%bqfactor(%sigma,%varlagsums)
compute bqfactor=%dmult(bqfactor,$
## SX11. Identifier %DMULT is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>te bqfactor=%dmult(<<<<
||%sign(bqfactor(1,1)),%sign(bqfactor(1,2))||)
Also, I am interested in analysing one negative unit shock on inflation on output. But the program makes this calculation on the basis of a one standard shock (which I assume is a positive shock). I don´t know if I´am making an interpretation mistake but if one is to calculate a sacrifice ratio, shouldn´t I be interested in seeing what is the response of output to a negative shock on inflation (the sacrifice ratio is usually defined as the output loss due to a one point permanent reduction on inflation). On the other hand, how can I get the confidence intervals for the response if It is a negative one point shock on inflation?
Thanks in advance.
compute bqfactor=%bqfactor(%sigma,%varlagsums)
compute bqfactor=%dmult(bqfactor,$
## SX11. Identifier %DMULT is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>te bqfactor=%dmult(<<<<
||%sign(bqfactor(1,1)),%sign(bqfactor(1,2))||)
Also, I am interested in analysing one negative unit shock on inflation on output. But the program makes this calculation on the basis of a one standard shock (which I assume is a positive shock). I don´t know if I´am making an interpretation mistake but if one is to calculate a sacrifice ratio, shouldn´t I be interested in seeing what is the response of output to a negative shock on inflation (the sacrifice ratio is usually defined as the output loss due to a one point permanent reduction on inflation). On the other hand, how can I get the confidence intervals for the response if It is a negative one point shock on inflation?
Thanks in advance.
Re: Creating negartive one unit shocks in impulse
The %DMULT was added with version 8. This will do the same thing with version 7:calvarez wrote:Hi Tom. Thank you very much for your reply. I run the program you posted but it seems to be an error when calculating the Blanchard-Quah decomposition. This the error I get:
compute bqfactor=%bqfactor(%sigma,%varlagsums)
compute bqfactor=%dmult(bqfactor,$
## SX11. Identifier %DMULT is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>te bqfactor=%dmult(<<<<
||%sign(bqfactor(1,1)),%sign(bqfactor(1,2))||)
Also, I am interested in analysing one negative unit shock on inflation on output. But the program makes this calculation on the basis of a one standard shock (which I assume is a positive shock). I don´t know if I´am making an interpretation mistake but if one is to calculate a sacrifice ratio, shouldn´t I be interested in seeing what is the response of output to a negative shock on inflation (the sacrifice ratio is usually defined as the output loss due to a one point permanent reduction on inflation). On the other hand, how can I get the confidence intervals for the response if It is a negative one point shock on inflation?
Thanks in advance.
Code: Select all
compute bqfactor=bqfactor*%diag(||%sign(bqfactor(1,1)),%sign(bqfactor(1,2))||)