impulse.responses {bvarsv}R Documentation

Compute Impulse Response Function from a Fitted Model

Description

Computes impulse response functions (IRFs) from a model fit produced by bvar.sv.tvp. 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).

Usage

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

Arguments

fit

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

impulse.variable

Variable which experiences the shock.

response.variable

Variable which (possibly) responds to the shock.

t

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

nhor

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

scenario

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.

draw.plot

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

Value

List of two elements:

contemporaneous

Contemporaneous impulse responses (vector of simulation draws).

irf

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).

Note

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 https://sites.google.com/site/FK83research/code.

Author(s)

Fabian Krueger

References

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 http://restud.oxfordjournals.org/content/82/4/1342/suppl/DC1 (accessed: 2015-11-17).

Examples

## Not run: 

data(usmacro)
set.seed(5813)
# Run BVAR; save parameters
fit <- bvar.sv.tvp(usmacro, save.parameters = TRUE)
# Impulse responses
impulse.responses(fit)


## End(Not run)

[Package bvarsv version 1.1 Index]