VARIRF - Impulse responses from VAR
This procedure organizes the graphs of an impulse response fuction from an already estimated VAR. Note that this just computes the IRF at the estimated coefficients; for error bands, you need to use MONTEVAR or the combination of MCVARDODRAWS and MCGRAPHIRF.
@VARIRF(model=VAR model,other options)
Options
MODEL=VAR model whose IRF's are to be calculated
FACTOR=Factor of the covariance matrix [Choleski of %SIGMA]
STEPS=number of forecast steps[48]
SHOCKLABELS=VECT[STRINGS] of labels for the shocks [dependent variables]
VARLABELS=VECT[STRING] of labels for the variables [dependent variables]
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.
ERRORS/[NOERRORS] Produce a forecast error variance decomposition
ACCUMULATE=||vector of positions||. Indicates which variables need to be accumulated (integrated)
Examples
This is from the standard RATS example IMPULSES.RPF. It overrides the variable labels with more meaningful names, and does the graphs two ways: the first is organized by shocks, which will give six graph pages, each with six graphs (in a 3 x 2 layout) with each page having the responses of the six variables to a different shock. The second set is organized by the target variable; again six pages with six graphs, this time each page having the responses of a different variable to all six shocks. PAGE=ALL would create one graph page with a 6 x 6 set of graphs, while PAGE=ONE would give 36 separate graph pages.
This example is from a structural VAR, and overrides both the shock labels and the variable labels. Variables 2, 3 and 4 are in the VAR in differenced form, and their cumulated responses are generated.
@VARIRF(model=VAR model,other options)
Options
MODEL=VAR model whose IRF's are to be calculated
FACTOR=Factor of the covariance matrix [Choleski of %SIGMA]
STEPS=number of forecast steps[48]
SHOCKLABELS=VECT[STRINGS] of labels for the shocks [dependent variables]
VARLABELS=VECT[STRING] of labels for the variables [dependent variables]
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.
ERRORS/[NOERRORS] Produce a forecast error variance decomposition
ACCUMULATE=||vector of positions||. Indicates which variables need to be accumulated (integrated)
Examples
This is from the standard RATS example IMPULSES.RPF. It overrides the variable labels with more meaningful names, and does the graphs two ways: the first is organized by shocks, which will give six graph pages, each with six graphs (in a 3 x 2 layout) with each page having the responses of the six variables to a different shock. The second set is organized by the target variable; again six pages with six graphs, this time each page having the responses of a different variable to all six shocks. PAGE=ALL would create one graph page with a 6 x 6 set of graphs, while PAGE=ONE would give 36 separate graph pages.
- Code: Select all
compute [vect[strings]] implabel=|| $
"US Real GDP",$
"Exchange Rate",$
"Short Rate",$
"M1",$
"Canada Real GDP",$
"CPI"||
@VARIRF(model=canmodel,steps=nsteps,$
varlabels=implabel,page=byshocks)
@VARIRF(model=canmodel,steps=nsteps,$
varlabels=implabel,page=byvariables)
This example is from a structural VAR, and overrides both the shock labels and the variable labels. Variables 2, 3 and 4 are in the VAR in differenced form, and their cumulated responses are generated.
- Code: Select all
dec vect[strings] shocklabels varlabels
compute shocklabels=||"Output","Inflation","Commodity Price","Stock Price","Monetary Policy"||
compute varlabels=||"Output Gap","Annual CPI Inflation","Commodity Price","Stock Prices","Federal Funds Rate"||
@varirf(model=varstockp,steps=nsteps,factor=f,page=byshock,$
shocks=shocklabels,varlabels=varlabels,accumulate=||2,3,4||)