impulse.responses {bvarsv}R Documentation

Compute Impulse Response Function from a Fitted Model


Computes impulse response functions (IRFs) from a model fit produced by The IRF describes how a variable responds to a shock in another variable, in the periods following the shock. To enable simple handling, this function computes IRFs for only one pair of variables that must be specified in advance (see impulse.variable and response.variable below).


impulse.responses(fit, impulse.variable = 1, response.variable = 2, 
                  t = NULL, nhor = 20, scenario = 2, draw.plot = TRUE)



Model fit produced by, with the option save.parameters set to TRUE.


Variable which experiences the shock.


Variable which (possibly) responds to the shock.


Time point from which parameter matrices are to be taken. Defaults to most recent time point.


Maximal time between impulse and response (defaults to 20).


If 1, there is no orthogonalizaton, and the shock size corresponds to one unit of the impulse variable. If scenario is either 2 (the default) or 3, the error term variance-covariance matrix is orthogonalized via Cholesky decomposition. For scenario = 2, the Cholesky decomposition of the error term VCV matrix at time point t is used. scenario = 3 is the variant used in Del Negro and Primiceri (2015). Here, the diagonal elements are set to their averages over time, whereas the off-diagonal elements are specific to time t. See the notes below for further information.


If TRUE (the default): Produces a plot showing the 5, 25, 50, 75 and 95 percent quantiles of the simulated impulse responses.


List of two elements:


Contemporaneous impulse responses (vector of simulation draws).


Matrix of simulated impulse responses, where rows represent simulation draws, and columns represent the number of time periods after the shock (1 in first column, nhor in last column).


If scenario is set to either 2 or 3, the Cholesky transform (transpose of chol) is used to produce the orthogonal impulse responses. See Hamilton (1994), Section 11.4, and particularly Equation [11.4.22]. As discussed by Hamilton, the ordering of the system variables matters, and should be considered carefully. The magnitude of the shock (impulse) corresponds to one standard deviation of the error term.

If scenario = 1, the function simply outputs the matrices of the model's moving average representation, see Equation [11.4.1] in Hamilton (1994). The scenario considered here may be unrealistic, in that an isolated shock may be unlikely. The magnitude of the shock (impulse) corresponds to one unit of the error term.

Further supporting information is available at


Fabian Krueger


Hamilton, J.D. (1994): Time Series Analysis, Princeton University Press.

Del Negro, M. and Primicerio, G.E. (2015). ‘Time Varying Structural Vector Autoregressions and Monetary Policy: A Corrigendum’, Review of Economic Studies 82, 1342-1345. Supplementary material available at (accessed: 2015-11-17).


## Not run: 

# Run BVAR; save parameters
fit <-, save.parameters = TRUE)
# Impulse responses

## End(Not run)

[Package bvarsv version 1.1 Index]