MCFEVDTABLE (Confidence bands for FEVD)

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

MCFEVDTABLE (Confidence bands for FEVD)

Postby TomDoan » Thu May 05, 2011 1:31 pm

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)
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby bonilla » Thu Aug 30, 2012 7:22 am

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.
bonilla
 
Posts: 8
Joined: Wed Aug 01, 2012 10:12 am

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby TomDoan » Thu Aug 30, 2012 7:32 am

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
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby bonilla » Thu Aug 30, 2012 9:46 am

It works. Thanks again!
bonilla
 
Posts: 8
Joined: Wed Aug 01, 2012 10:12 am

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby CRMS » Fri Apr 12, 2013 12:11 pm

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?
CRMS
 
Posts: 6
Joined: Fri Mar 23, 2012 9:52 am

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby TomDoan » Fri Apr 12, 2013 2:21 pm

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".
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby CRMS » Tue Apr 16, 2013 11:26 am

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.
CRMS
 
Posts: 6
Joined: Fri Mar 23, 2012 9:52 am

Re: MCFEVDTABLE (Confidence bands for FEVD)

Postby TomDoan » Tue Apr 16, 2013 12:05 pm

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.
TomDoan
 
Posts: 2717
Joined: Wed Nov 01, 2006 5:36 pm


Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 1 guest