IMPULSE Instruction |
IMPULSE( options )
# first period shocks (only with INPUT option)
# list of path series (only with PATHS option)
IMPULSE generates the responses of a system of equations to a specified set of shocks. The impulse response functions are the dynamic response of each endogenous variable to a shock to the system. The main use of IMPULSE is to generate a moving average representation (MAR) of a vector autoregression.
IMPULSE can only work for linear models as it relies upon linearity properties of moving average representations. In a non-linear system, the responses to shocks depend upon the initial point around which you are expanding.
The syntax for IMPULSE has changed quite a bit over the years. A pre-version 7 IMPULSE instruction will look quite different from the preferred setup now, as it would use parameters and supplementary cards rather than options and MODELS. A description of the "Older Syntax" is provided below.
Wizard
In the Time Series—VAR (Forecast/Analyze) Wizard choose "Impulse Responses" in the Action drop down.
Options
MODEL=model name [unused]
Of the two ways to input the form of the model to be solved (the other is with supplementary cards), this is the more convenient. MODELs are usually created by GROUP or SYSTEM. It can include FRML's (formulas) only if they represent simple linear equations, as IMPULSE requires that the model be fully linear. If the model includes any identities, those should be last in the model. If you use this, omit the “equation” supplementary cards.
STEPS=number of impulse response steps to compute [not used]
This sets the number of steps (periods) for which you wish to compute responses. If you have set a SMPL, this defaults to the number of steps implied by it. Otherwise, you must supply a value.
COLUMN=component to shock [shock all components]
By default, IMPULSE computes a complete set of responses for shocks to each of the equations. Use COLUMN if you want to shock only a particular column of the covariance or factor matrix.
CV=SYMMETRIC covariance matrix of residuals [from MODEL]
FACTOR=RECTANGULAR decomposition matrix [unused]
Use CV if you want the orthogonalization computed using a Cholesky factorization of the covariance matrix. If you are using the MODEL option and omit this option, IMPULSE defaults to using the estimated covariance matrix for the MODEL.
As an alternative, you can use FACTOR to supply your own factorization of the covariance matrix, such as the factor matrix produced by a CVMODEL instruction. (This option was called DECOMP in versions before 7. DECOMP is still recognized as a synonym for FACTOR.) FACTOR can have a reduced number of columns, but must have rows equal to the number of (structural) equations.
RESULTS=(output) RECTANGULAR[SERIES] for result series
FLATTEN=(output) RECT for use with %%RESPONSES
RESULTS provides a RECTANGULAR array of SERIES which will be filled with the results. This will usually be used when you are getting the full moving average representation of a VAR (i.e. when not using the COLUMN option), when it will have dimensions \(N \times N\). The responses to the shock in innovation i will be column i in the matrix. If you requesting responses to a single shock, the matrix will have dimensions \(N \times 1\). Each series created will be filled from entries 1 to steps.
FLATTEN packs the results into a NVAR*NSHOCKS x steps matrix in the form needed for an element of the %%RESPONSES array.
[PRINT]/NOPRINT
TITLE="title for output" [none]
WINDOW="title of window" [not used]
Use NOPRINT to suppress the display of the responses to the output window or file. If you use the PRINT option, it will add the TITLE string (if used) to the top of the output (just once).
Use the WINDOW option if you want to display the output in a (read-only) spreadsheet window, which will have the title you supply. The output will be organized as separate sub–tables for each variable shocked. You can export information from this window to a file in a variety of formats using the File–Export... operation.
LABELS=VECTOR[STRINGS] to label shocks
You can use the LABELS option to assign specific labels to the shocks if the standard practice of labelling them with the corresponding dependent variable would be misleading. This matters only if you are using the FACTOR option.
INPUT/[NOINPUT]
SHOCKS=VECTOR for first period shocks to add in [unused]
You can use one of these options to input general first period shocks. With INPUT, you supply the shocks on a supplementary card of the second form; with SHOCKS, the indicated VECTOR provides the shocks. See "Technical Details".
MATRIX=RECTANGULAR matrix for time paths of shocks [unused]
PATHS/[NOPATHS]
START=starting entry for PATHS series [1]
You can use either MATRIX or PATHS to input the paths of shocks over more than one period.
With MATRIX, you set up a RECTANGULAR array to provide the paths of shocks to the equations. The columns of the array should match the order of the equations, that is, the shocks to the first equation should be in the first column. The number of rows does not have to be equal to steps. The shocks will be set to zero for any steps beyond those supplied by the array.
With PATHS, you supply a list of series on a supplementary card. These series provide the paths of the shocks. You must define these series for steps entries beginning with the START option entry. Use * on the supplementary card for any equation whose shocks are to be zero for the entire period.
ACCUMULATE=||vector of positions||
Indicates which variables (by position in the model) need to be accumulated (integrated)
Variables Defined
%FSTART |
Starting entry of responses (will be 1) (INTEGER) |
%FEND |
Ending entry of responses (INTEGER) |
Technical Details and Choices for Providing Shocks
In the moving average representation,
(1) \({{\bf{y}}_t} = \sum\limits_{s = 0}^\infty {{\Psi _s}{{\bf{u}}_{t - s}}} \)
the response at t=k to an initial shock \({\bf{z}}\) in the \({\bf{u}}\) process is \(\bf{\Psi}_k\bf{z}\). For instance, the response at step k to a unit shock in equation i at t=0 is just the ith column of the \(\bf{\Psi}_k\) matrix.
IMPULSE allows the shock to the system to take one of several forms:
1.First period shock which is a unit shock to an orthogonalized innovation of the process. If \({\rm{Var}}({\bf{u}}) = \Sigma = {\bf{FF'}}\), then \({\bf{u}} = {\bf{Fv}}\) where \({\rm{Var}}({\bf{v}}){\rm{ = }}I\). A shock of unit size to the ith component of \({\bf{v}}\) is a \({\bf{z}}\) vector which is the ith column of \({\bf{F}}\). Implement by setting COLUMN to the component you want shocked. \({\bf{F}}\) will be a Cholesky factor by default, so use the FACTOR option if you want a different factor matrix.
2.General first period shocks (\({\bf{z}}\) vector). Implement using either the SHOCKS option (preferred) or the INPUT option (including an additional supplementary card with the shocks).
3.Paths of shocks to one or more equations. Implement using either the PATHS option (including an additional supplementary card listing the series of shocks) or the MATRIX option.
Examples
These examples use a six variable VAR (the one from the example program IMPULSES.RPF). The interest rate is the third variable in the system, which is used in several of the examples.
impulse(model=canmodel,steps=20,results=impulses)
computes twenty steps of the impulse responses to all the orthogonalized shocks to the equations in CANMODEL. IMPULSES(i,j) is a series defined from entries 1 to 20 which has the response of the ith dependent variable to a shock in the jth.
impulse(model=canmodel,steps=24,col=3,window="Shock to Rate")
shocks the third orthogonalized component (the rate shock) and puts 24 step responses out to a window.
impulse(model=canmodel,steps=20,factor=bfactor,$
window="Responses",labels=||"f1","f2","r1","r2","n1","n2"||)
puts out to a window a 20 step response to each of the components in an orthogonalized system. The shocks are given labels of f1, f2, r1, r2, n1 and n2.
impulse(model=canmodel,steps=24,shock=%unitv(6,3),noprint,results=torate)
computes the response to a unit shock in the interest rate alone (not an orthogonalized component). So the impact on the interest rate with be 1.0 initially, while all other variables will have an impact shock of 0. TORATE(i,1) will be the response of variable i to the shock. Note that you must be very careful with the scaling of shocks like this. A unit shock to a variable in log's means an impact the same as multiplying the data by 2.718. Unit shocks in orthogonalized components as in the previous examples all adjust automatically to the scale of the variables.
set shockr 1 3 = 1.00
set shockr 4 10 = 0.00
impulse(model=canmodel,paths,steps=10,noprint,results=persist)
# * * shockr * * *
gives shocks of size 1.00 to the interest rate in each of the first three (of ten) periods.
IMPULSE( options ) equations steps shockto VCVmatrix
# equation response newstart column (one per equation)
# first period shocks (only with INPUT option)
# list of path series (only with PATHS option)
Parameters
equations |
number of equations |
steps |
number of steps to compute. Prefer the newer STEPS option. |
shockto |
variable/component to shock. Prefer the newer COLUMN option. |
VCVmatrix |
covariance matrix for Cholesky factor. Prefer the newer CV option. |
Equation Supplementary cards (if not using MODEL)
If you aren’t using the MODEL option, supply one supplementary card for each equation in the system. The order of listing affects the decomposition order. You must list supplementary cards for identities last.
equation |
the equation name or number |
response |
(Optional) The series for the response of the dependent variable of equation. RATS ignores response if you use a single IMPULSE instruction to print responses to each of the variables in turn. You can get the whole matrix of responses by using the RESULTS option. |
newstart |
start entry for stored responses, default is 1 |
column |
(Optional) The column of the CV matrix which corresponds to this equation. By default: this is just the supplementary card position: that is, first supplementary card corresponds to column one, second card to column two, etc. |
Examples with Supplementary Cards
impulse(steps=20,column=2,cv=v) 3
# 3 impm 1 3
# 1 impg 1 1
# 2 impp 1 2
looks at the shock to the orthogonalized innovation to equation 1 (2nd listed), with the decomposition done in the order 3–1–2. The responses are saved in series IMPM, IMPG, IMPP.
impulse(input,steps=20,noprint) 3
# 1 resp1
# 2 resp2
# 3 resp3
# 1.0 -1.0 0.0
computes responses over 20 periods to a shock in the first period of 1.0 to the first equation and –1.0 to the second. This saves the responses in RESP1, RESP2 and RESP3.
LIST and CARDS
If you’re using supplementary cards to describe the model rather than a MODEL, these often follow a simple pattern, for instance,
impulse(steps=20,column=1,cv=v) 4
# 1 resp(1) 1 1
# 2 resp(2) 1 2
# 3 resp(3) 1 3
# 4 resp(4) 1 4
Each card has the form # ieqn resp(ieqn) 1 ieqn.
You may find the LIST and CARDS utility to be very useful for handling batches of supplementary cards like this. You could replace the above example with the following:
list ieqn = 1 2 3 4
impulse(steps=20,column=1,cv=v) 4
cards ieqn resp(ieqn) 1 ieqn
Copyright © 2025 Thomas A. Doan