Learn R Programming

bvarsv (version 1.1)

impulse.responses: 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).

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

Run this code
## 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)

Run the code above in your browser using DataLab