Page 1 of 1

MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Thu May 05, 2011 1:31 pm
by TomDoan
This is a procedure for generating error bands for the FEVD (forecast error variance decomposition) in a VAR using the output from a Monte Carlo procedure such as MCVARDODRAWS.

Updated 30 August 2012 to add PICTURE option.

mcfevdtable.src
Procedure file
(6.73 KiB) Downloaded 56 times


Note: this assumes that the shocks used in generating the IRF's are orthogonal and produce a complete factorization of the covariance matrix. It cannot be used with isolated shocks (from, for instance, sign restrictions). It needs to compute a separate decomposition for each draw and aggregates those. Note that FEVD's are very asymmetrical and it is not uncommon for the point estimate of the FEVD from least squares estimation of the VAR to be outside the confidence interval, particularly near the zero end.

@MCFEVDTABLE(MODEL=model used in generating responses,other options)

Options
SHOCKLABELS=VECT[STRINGS] of labels for the shocks [dependent variables of model]
VARLABELS=VECT[STRING] of labels for the variables [dependent variables of model]

INCLUDE=||list of dependent variables to show (in order, by position in model)|| [all]
INCLUDE can be used to eliminate some variables which aren't of special interest or to rearrange the panes on a graph. For instance, in a 6 variable VAR, INCLUDE=||6,1,3,4|| will show only the responses of those four variables (based upon their positions in the model) and will put the 6th variable in the top left.

HORIZONS=VECT[INT] of forecast horizons to include [||1,2,3,4,8,12,40||]

PERCENTILES=||percentiles for lower and upper bounds|| [||.16,.84||]
STDDEV=# of standard deviations from mean for lower and upper bounds [not used]
STDDEV is used for doing error bands based upon multiples of the sample standard deviations. For instance, STDDEV=1.0 will give upper and lower bounds that are one standard deviation above and below the mean response. PERCENTILES is the default.

TABLE=[BYVARIABLE]/BYSHOCK
Organization for the table

PICTURE=picture code for displaying percentages ["##.#"]

Example

Code: Select all
*
* Replication for Blanchard and Quah(1989), "The Dynamic Effects of
* Aggregate Demand and Supply Disturbances", AER, vol 79, no. 4, pp
* 655-673.
*
* This includes the figures and tables that require simulations. Note
* that BQ used bootstrapping, which did not work well in this case. This
* is a point made in Sims and Zha(1999), "Error Bands for Impulse
* Responses", Econometrica, vol 67, no. 5, pp 1113-1156. These are done
* by Monte Carlo integration with the standard "Jeffrey's" prior.
*
cal(q) 1948
open data bqdata.xls
data(format=xls,org=cols) 1948:1 1987:4 gnp gd87 lhmur
*
* Generate log real GNP from the gnp and the price deflator
*
set loggnp   = log(gnp)
set loggd    = log(gd87)
set logrgnp  = loggnp-loggd+log(100)
set dlogrgnp = 100.0*(logrgnp-logrgnp{1})
*
* BQ de-mean the GNP growth data with separate values for two subsamples.
*
set dummy1 = t<=1973:4
set dummy2 = t>1973:4
*
linreg dlogrgnp
# dummy1 dummy2
set gnpadjust = %resids
prj removed
*
* The unemployment rate is detrended
*
filter(remove=trend) lhmur / uradjust
*
*****************************************
compute [vect[strings]] shocklabels=||"Supply","Demand"||
compute [vect[strings]] varlabels=||"Output","Unemployment"||
*
system(model=varmodel)
var gnpadjust uradjust
lags 1 to 8
det constant
end(system)
*
estimate(noprint)
@BQDoDraws(model=varmodel)
@MCGraphIRF(model=varmodel,shocklabels=shocklabels,varlabels=varlabels)
*
disp "Table 2-Variance Decomposition. Output growth break; Unemployment Detrended"

@MCFEVDTable(model=varmodel,horizons=||1,2,3,4,8,12,40||,$
  varlabels=varlabels,shocklabels=shocklabels,table=byshocks)

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Thu Aug 30, 2012 7:22 am
by bonilla
Dear Estima,

The Procedure MCFEVCTable is really useful, thanks !

How can I modify the Procedure in order to get a different number of decimal digits in the output ? More precisely, how can I do in order to get the output of the forecast error variance decomposition with three decimal digits instead of just one? (e.g. I get 8.9 and I want 8.915)

Thanks a lot.

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Thu Aug 30, 2012 7:32 am
by TomDoan
Change the ##.# in the next two lines to ##.###

report(use=freport,atrow=baserow ,atcol=j+1,align=center) %strval(100*frac(2),"##.#")
report(use=freport,atrow=baserow+1,atcol=j+1,align=center) %strval(100*frac(1),"##.#")+","+%strval(100*frac(3),"##.#")

With the August 2012 revision, you can do the same thing by using the PICTURE="##.###" option

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Thu Aug 30, 2012 9:46 am
by bonilla
It works. Thanks again!

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Fri Apr 12, 2013 12:11 pm
by CRMS
I get the following mistake when using this procedure:

## OP3. This Instruction Does Not Have An Option TIT
>>>>ction=define,title=<<<<

Is this due to me still using RATS 7, or could there be other reasons?

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Fri Apr 12, 2013 2:21 pm
by TomDoan
CRMS wrote:I get the following mistake when using this procedure:

## OP3. This Instruction Does Not Have An Option TIT
>>>>ction=define,title=<<<<

Is this due to me still using RATS 7, or could there be other reasons?


Yes. The TITLE option was added to REPORT with 7.3. You can take that option out of the REPORT instruction and it will work---it will just be labeled as "user report".

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Tue Apr 16, 2013 11:26 am
by CRMS
Thank you, now it works indeed.

Should I be worried if my variance decomposition by variable does not add up to 100.0 for most of the variables and time horizons? For some of the longer horizons I even get values below 90.0... Of course the error bands are large enough to still allow for the 100.0 to be included, but I feel somehow unsure about how to present these results.

Re: MCFEVDTABLE (Confidence bands for FEVD)

PostPosted: Tue Apr 16, 2013 12:05 pm
by TomDoan
CRMS wrote:Thank you, now it works indeed.

Should I be worried if my variance decomposition by variable does not add up to 100.0 for most of the variables and time horizons? For some of the longer horizons I even get values below 90.0... Of course the error bands are large enough to still allow for the 100.0 to be included, but I feel somehow unsure about how to present these results.


With two variables, you can't have that problem. Once you're beyond a two variable system, the results get increasingly difficult to interpret. It's not clear to me that these add any real value to IRF graphs.