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 |
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 |
draw.plot |
If |
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, |
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)