MCGraphIRF - Organizing graphs for IRF's in VAR

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

MCGraphIRF - Organizing graphs for IRF's in VAR

Postby TomDoan » Fri Jul 17, 2009 2:56 pm

The attached file is a procedure for organizing the graphs of impulse responses in a VAR. It is assumed that some form of Monte Carlo analysis or bootstrapping was done to generate a collection of IRF's. By splitting up the tasks of generating those responses (done by some other procedure) and graphing them, this procedure can concentrate on making the graphs look as nice as possible.

mcgraphirf.src
(10.59 KiB) Downloaded 327 times


Prior to using @MCGraphIRF, you have to fill in the global array %%responses. This is a VECT[RECT] with outer dimensions NDRAWS. Each draw is represented by a RECT array, with NVAR*NSHOCKS rows and NSTEPS columns. The rows are blocked by shocks so the first set of NVAR elements in a column are the responses to the first shock, the second set are the responses to the second shock. If you %VEC a set of impulse responses produced by IMPULSES, that's how they will be blocked. The following shows a typical way that this can be created:

Outside the draw loop (draws is the number of draws being made):

Code: Select all
declare vect[rect] %%responses
dim %%responses(draws)


Inside of it (draw is the current draw number)

Code: Select all
   impulse(noprint,model=model,factor=fsigmad,results=impulses,steps=steps)
   dim %%responses(draw)(nvar*nvar,steps)
   ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)


The options for MCGraphIRF are:

MODEL=model used in generating responses [you need to use this, since it's the source of other information]

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.

CENTER=[MEAN]/MEDIAN/INPUT
IMPULSES=RECT[SERIES] of central impulse responses for the graph
The CENTER option chooses what is shown as the "estimate" of the IRF. MEAN and MEDIAN are the
mean and median of the drawn responses. INPUT means that you are including an IMPULSES option with RECT[SERIES] which are to be used. This needs to be in the format created by the IMPULSE instruction.

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 central response. PERCENTILES is the default. It can give either two or four values, which should be ordered from low to high.

HEADER=' title for graph '
FOOTER=' footer for graph '
PAGE=[ALL]/ONE/BYSHOCK/BYVARIABLE
COLUMNS=# of columns on a page [depends upon number of graphs]
The PAGE option selects the layout of a single page of graphs.

PAGE=ALL (the default) does all responses to all shocks on a single page (shocks in columns, dependent variables in rows). Note that the panes get a bit small when you get more than four variables.

PAGE=ONE does one combination of shock and variable per page.

PAGE=BYSHOCK does a separate page for each shock, with all responses arranged in one or more columns.

PAGE=BYVARIABLE does a separate page for each variable, with all shocks arranged in one or more columns.

If you used an earlier version of this procedure, please note that the blocking in %%responses is different than in the "draft" versions. You need to get new versions of the "drawing" procedure as well.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 3 guests