Page 1 of 1
IRFs and VDC for levels
Posted: Sun Jul 05, 2009 2:05 am
by ursula
Hello. Asking for your help once more, how can I obtain the IRFs and variance decomposition with confidence bands for levels, once I have them for the first difference of variables? The confidence intervals for IRFs and VDC are estimated using Monte Carlo. Thank you.
Re: IRFs and VDC for levels
Posted: Sun Jul 05, 2009 10:11 am
by TomDoan
That's what those "ACCUMULATE" instructions are doing in the BQDoDraws procedure--they convert responses of the first difference into responses of the levels.
Re: IRFs and VDC for levels
Posted: Sun Jul 05, 2009 11:02 am
by ursula
Ok, thank you. Then it's my data that looks strange.
Re: IRFs and VDC for levels
Posted: Sun Jul 05, 2009 1:55 pm
by TomDoan
Make sure you're only accumulating the responses for the variables that are in the VAR in differences. The typical BQ model has one variable in differences (such as log GDP) and one in levels.
Re: IRFs and VDC for levels
Posted: Wed Jul 17, 2019 12:09 pm
by ateeb
if all of my variables are stationary in level and I do the following:
compute nvar=5 *Number of variables
do ilag=1,12
system(model=aiclag)
variables x1 x2 x3 x4 x5
lags 1 to ilag
det constant
end(system)
estimate(noprint,outsigma=vmat) 2000:01 2010:12
compute logdet=log(%det(vmat))
compute capn=nvar*nvar*ilag+nvar
compute aicp=2*capn
compute aic=%nobs*logdet+aicp
display ilag @5 #### @15 ####.#### aic
end do ilag
*
SYSTEM(model=aiclag1)
VAR x1 x2 x3 x4 x5
LAGS 1 TO 9
DET CONSTANT
END(SYSTEM)
estimate(noprint,resids=resids8) 2000:01 2010:12
compute logdetu=%logdet
compute mcorr=%nreg,ntotal=%nregsystem
make residuals 2000:01 2010:12
# resids8(1) resids8(2) resids8(3) resids8(4) resids8(5)
do i=resids8(1),resids8(5)
correlate(qstats,number=12) i 2000:01 2010:12
end do i
ERRORS(model=aiclag1,SAVE=ERSAVE,steps=48)
@MCVARDoDraws(model=aiclag1,draws=10000,steps=48)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||3||,onlyshocks=||1||,page=byshock,stddev=2.0)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||4||,onlyshocks=||1||,col=1,page=byshock,stddev=2.0)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||5||,onlyshocks=||1||,col=1,page=byshock,stddev=2.0)
Question 1: The standard errors for VDCs are same for all individual share of explanation of forecast error variance, for example line from decompositions of variable 1 by all others at horizon 12 is:
VDC of x1 suppose:
h Std Error x1 x2 x3 x4 x5
12 1.06846887 2.014 0.668 1.098 65.481 30.739
so in my results would i report the same standard error for all?
Question 2: is the program written correctly for calculating AIC and doing subsequent estimation and VDC and IRF?
Re: IRFs and VDC for levels
Posted: Wed Jul 17, 2019 4:28 pm
by TomDoan
ateeb wrote:if all of my variables are stationary in level and I do the following:
compute nvar=5 *Number of variables
do ilag=1,12
system(model=aiclag)
variables x1 x2 x3 x4 x5
lags 1 to ilag
det constant
end(system)
estimate(noprint,outsigma=vmat) 2000:01 2010:12
compute logdet=log(%det(vmat))
compute capn=nvar*nvar*ilag+nvar
compute aicp=2*capn
compute aic=%nobs*logdet+aicp
display ilag @5 #### @15 ####.#### aic
end do ilag
*
SYSTEM(model=aiclag1)
VAR x1 x2 x3 x4 x5
LAGS 1 TO 9
DET CONSTANT
END(SYSTEM)
estimate(noprint,resids=resids8) 2000:01 2010:12
compute logdetu=%logdet
compute mcorr=%nreg,ntotal=%nregsystem
make residuals 2000:01 2010:12
# resids8(1) resids8(2) resids8(3) resids8(4) resids8(5)
do i=resids8(1),resids8(5)
correlate(qstats,number=12) i 2000:01 2010:12
end do i
ERRORS(model=aiclag1,SAVE=ERSAVE,steps=48)
@MCVARDoDraws(model=aiclag1,draws=10000,steps=48)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||3||,onlyshocks=||1||,page=byshock,stddev=2.0)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||4||,onlyshocks=||1||,col=1,page=byshock,stddev=2.0)
@MCGraphIRF(model=aiclag1,center=mean,INCLUDE=||5||,onlyshocks=||1||,col=1,page=byshock,stddev=2.0)
Question 1: The standard errors for VDCs are same for all individual share of explanation of forecast error variance, for example line from decompositions of variable 1 by all others at horizon 12 is:
VDC of x1 suppose:
h Std Error x1 x2 x3 x4 x5
12 1.06846887 2.014 0.668 1.098 65.481 30.739
so in my results would i report the same standard error for all?
I'm not sure what you mean by that. But no one reports the results of the "Std Error" field computed by ERRORS. It's the theoretical standard error of out-of-sample forecasts assuming the coefficients are known, which is not really an interesting value.
ateeb wrote:
Question 2: is the program written correctly for calculating AIC and doing subsequent estimation and VDC and IRF?
My suggestion would be to use
@VARLAGSELECT to do a search for lag length. You don't have to write your own program for that. 12 lags on 5 variables with 11 years of monthly data are too many. (The AICC computed by @VARLAGSELECT will probably give you a different result than a straight AIC).
The rest is OK, though I'm not sure why you would do three separate @MCGRAPHIRF. You could do INCLUDE=||3,4,5|| with PAGE=ONE and get the same result. (Three pages with one set of responses.)
Re: IRFs and VDC for levels
Posted: Thu Aug 22, 2019 9:33 pm
by ateeb
In the example that i gave above, if all the variables X1 to X5 are stationary in levels and I use estimate command it will estimate the model in first differences right?
In that case aren't the VDCs and IRFs going to be of the system estimated in first differences? how to get responses for variables in levels since they are all stationary in levels and have no cointegration?
Re: IRFs and VDC for levels
Posted: Fri Aug 23, 2019 7:15 am
by TomDoan
ateeb wrote:In the example that i gave above, if all the variables X1 to X5 are stationary in levels and I use estimate command it will estimate the model in first differences right?
No. It estimates it in levels. If the series are stationary, you don't
want to estimate in first differences---that induces a unit root in the residuals which would require a theoretically infinite set of lags to unwind.